Skip to content

Instantly share code, notes, and snippets.

View Steakeye's full-sized avatar

Andrew Keats Steakeye

View GitHub Profile
@Steakeye
Steakeye / System Design.md
Created June 1, 2023 14:51 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@Steakeye
Steakeye / system-design-cheat-sheat.md
Created June 1, 2023 14:50 — forked from krebernisak/system-design-cheat-sheat.md
System design cheat sheet - It can be used for interviews or assessments (forked from Nikolay Ashanin)

System design cheat sheet

It can be used for interviews or assessments.

1. Understand problem and scope:

  • Recognize stakeholders and prioritize them. Create RACI matrix
  • Understand business drivers of the project
  • Recognize end-users of the project and understand how they will use that system
  • Check functional requirements
  • Define external dependencies
  • Suggest additional features
  • Remove items that interviewer considers out of scope
// Puppeteer cheat sheet
// gonna try and do for puppeteer what capybara got: https://gist.github.com/zhengjia/428105
// to delete an input value
function DeleteInput(page, inputSelector, word){
// input must be focused
page.type(inputSelector, '')
for (let i = 0; i < word.length; ++i) {
@Steakeye
Steakeye / Create-Administrator.ps1
Created March 4, 2018 04:33 — forked from ducas/Create-Administrator.ps1
Create a local administrator account using PowerShell
$Username = "su"
$Password = "password"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }
if ($existing -eq $null) {
@Steakeye
Steakeye / gist:620411f8f7ccbf6802048d35c0f12e66
Created November 6, 2017 13:01 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

The three design patterns (Adapter, Facade and Bridge) all produce the result of a clean public API. The difference between the patterns are usually due to a subtle context shift (and in some cases, a behavioural requirement).

Adapter

The primary function of an Adapter is to produce a unified interface for a number of underlying and unrelated objects.

You will notice this pattern being utilised in many applications. For example, ActiveRecord (the popular Ruby ORM; object-relational mapping) creates a unified interface as part of its API but the code underneath the interface is able to communicate with many different types of databases. Allowing the consumer of the API to not have to worry about specific database implementation details.

The principle structure of this pattern is:

@Steakeye
Steakeye / destructuring.js
Created October 28, 2017 12:23 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@Steakeye
Steakeye / p4merge-git-tool.md
Created June 7, 2017 13:14 — forked from dgoguerra/p4merge-git-tool.md
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@Steakeye
Steakeye / README.md
Created March 29, 2017 14:14 — forked from hofmannsven/README.md
My simple SCSS Cheatsheet