Skip to content

Instantly share code, notes, and snippets.

View Poogles's full-sized avatar

Sam Pegler Poogles

View GitHub Profile
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@favila
favila / async-util.clj
Created November 28, 2014 17:06
Some missing pieces of core.async. as-transducer: Make a transducer function easily without Clojure 1.7. go-pipe: async/pipe, but returns the go-loop. fast-pipeline-blocking: faster than async/pipeline-blocking, but unordered results. blocking-consumer: consume a channel with multiple worker threads.
(ns favila.async-util
"Some missing pieces of core.async.
as-transducer: Make a transducer function easily without Clojure 1.7.
go-pipe: async/pipe, but returns the go-loop.
fast-pipeline-blocking: faster than async/pipeline-blocking, but unordered results.
blocking-consumer: consume a channel with multiple worker threads."
(:require [clojure.core.async :as async
:refer [go go-loop <! >! <!! >!! close! take! put! chan]]))
@jboner
jboner / latency.txt
Last active May 21, 2024 18:29
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@honza
honza / sigterm.py
Created April 6, 2012 22:22
Sigterm handler in Python
"""
This snippet shows how to listen for the SIGTERM signal on Unix and execute a
simple function open receiving it.
To test it out, uncomment the pid code and kill the process with:
$ kill -15 pid
"""
import signal
import sys