Skip to content

Instantly share code, notes, and snippets.

View ziyunli's full-sized avatar
:shipit:
shipit

Ziyun "Stephen" Li ziyunli

:shipit:
shipit
View GitHub Profile
@staltz
staltz / introrx.md
Last active September 24, 2026 11:47
The introduction to Reactive Programming you've been missing

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 March 1, 2026 16:21
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 22, 2025 14:54
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 August 1, 2026 00:33
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 September 15, 2025 06:47
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 September 28, 2026 01:39
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?