Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active July 28, 2025 11:58
The introduction to Reactive Programming you've been missing
@prakhar1989
prakhar1989 / richhickey.md
Last active January 30, 2025 06:39 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@nolanlawson
nolanlawson / protips.js
Last active November 19, 2024 02:40
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@bruienne
bruienne / xhyverun.sh
Last active October 4, 2018 09:40
xhyve boot2docker sample config
#!/bin/sh
KERNEL="/path/to/vmlinuz64"
INITRD="/path/to/initrd.img"
#CMDLINE="earlyprintk=serial console=ttyS0 acpi=off"
CMDLINE="loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10:LABEL=boot2docker-data base"
MEM="-m 1G"
#SMP="-c 2"
NET="-s 2:0,virtio-net,en0"
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@ocornut
ocornut / imgui_node_graph_test.cpp
Last active July 29, 2025 14:42
Node graph editor basic demo for ImGui
// Creating a node graph editor for Dear ImGui
// Quick sample, not production code!
// This is quick demo I crafted in a few hours in 2015 showcasing how to use Dear ImGui to create custom stuff,
// which ended up feeding a thread full of better experiments.
// See https://github.com/ocornut/imgui/issues/306 for details
// Fast forward to 2023, see e.g. https://github.com/ocornut/imgui/wiki/Useful-Extensions#node-editors
// Changelog
// - v0.05 (2023-03): fixed for renamed api: AddBezierCurve()->AddBezierCubic().
@vi
vi / rust_wine.md
Last active May 20, 2024 23:46
Using Rust in Wine as a sort of cross-compiler

Cross-compiling Rust from Linux to Windows using Wine

🔴 Note: this article is obsolete. This cross-compilation direction may just work out of the box. 🔴

0. Ensure Rust works on Host

Let's create a dummy project for a test.

$ cargo new test
@scturtle
scturtle / gist:15685020c01e4c5a8072
Last active July 8, 2017 13:21
ffmpeg cheatsheet
# https://support.twitter.com/articles/20172128?lang=en#video-formats
# https://trac.ffmpeg.org/wiki/Encode/H.264
# gif to mp4 for twitter
ffmpeg -i in.gif -pix_fmt yuv420p -vf crop="floor(in_w/2)*2:floor(in_h/2)*2" out.mp4
# extract part of video (-t duration)
ffmpeg -i in.mp4 -ss 00:00:00.000 -to 00:00:15.000 -vcodec copy -acodec copy part.mp4
# convert to mp4 for twitter
@vasanthk
vasanthk / System Design.md
Last active July 29, 2025 06:47
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?