Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@vasanthk
vasanthk / System Design.md
Last active July 22, 2024 05:05
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?
@jesstelford
jesstelford / event-loop.md
Last active June 7, 2024 17:12
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@dayne
dayne / 0-WLS_Removing Win Path.md
Last active June 23, 2024 06:08
Cleaning up WLS path to remove /mnt/c paths (world writable).

The Windows Linux Subsystem (WSL) comes with /win/c mounted world read-write and is setup for compatibility between windows and linux by putting all your windows paths into your linux system path. This is great for some usecases. Some tools get grumpy having these world writable directories a users path. While this doesn't break them but it can cause annoying warning messages.

On the other hand, when you don't care about the windows tools being in your path, it might make you more sane not to see those error messages, and also to limit the number of places tools look for supporting binaries not-relevant to themselves.

: warning: Insecure world writable dir /mnt/c in PATH, mode 040777

You can remove all those /mnt/c paths from your $PATH with the following line:

const {useCallback, useEffect, useReducer, useRef} = require('react');
let effectCapture = null;
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) {
let updateCounter = useRef(0);
let wrappedReducer = useCallback(function(oldWrappedState, action) {
effectCapture = [];
try {
let newState = reducer(oldWrappedState.state, action.action);
@yxztj
yxztj / TaskConcurrencyManifesto.md
Last active March 1, 2024 07:01 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto 中文翻译
@danwagnerco
danwagnerco / wifeyalpha_books.md
Last active January 7, 2024 15:04
WifeyAlpha recommended reading