Skip to content

Instantly share code, notes, and snippets.

View ededejr's full-sized avatar

Edede Oiwoh ededejr

View GitHub Profile
@agalatan
agalatan / Conditionals.js
Last active June 29, 2022 22:08
[Flow] Conditional types
// See the flow link at the bottom, and the GIT comment below
// Good utils
type $If<X: boolean, Then, Else = empty> = $Call<((true, Then, Else) => Then) & ((false, Then, Else) => Else), X, Then, Else>;
type $Not<X: boolean> = $If<X, false, true>;
type $And<X: boolean, Y: boolean> = $If<X, Y, false>;
type $Or<X: boolean, Y: boolean> = $If<X, true, Y>;
// Unique, internal Symbols. Probably I can actually use JS's Symbol. Need to see how well Flow implements it
@vasanthk
vasanthk / System Design.md
Last active June 26, 2024 17:33
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?