Skip to content

Instantly share code, notes, and snippets.

View jadbox's full-sized avatar

Jonathan Rose Dunlap jadbox

View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@domenic
domenic / promises.md
Last active April 1, 2025 01:54
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@jgranick
jgranick / .htaccess
Last active June 3, 2019 14:19
SimpleGL
SetOutputFilter DEFLATE
@mironov
mironov / trello-to-kanbanery.rb
Created May 15, 2013 19:03
Import tasks from trello to kanbanery
require "json"
require "csv"
json = File.read("qa.json")
parsed_json = JSON.parse(json)
lists = {}
parsed_json["lists"].each do |list|
lists[list["id"]] = list["name"]
end
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.
@jfarmer
jfarmer / 00_LICENSE.md
Last active January 4, 2017 08:43
It's like lisp, in JavaScript!
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int i = 0;
char x;
while (i++ < 10000000) {
int zipcode, temperature, relhumidity;
zipcode = random() % 100000;
temperature = random() % 100000;
@vittorioromeo
vittorioromeo / FastFunc.hpp
Last active August 24, 2023 08:15
Don Clugston's fast delegate C++11 implementation
#ifndef SSVU_FASTFUNC
#define SSVU_FASTFUNC
#include <cstring>
#include <type_traits>
#include <cassert>
#include <cstddef>
#include <memory>
#include <new>
#include <utility>
@rtgibbons
rtgibbons / logger.js
Created November 7, 2013 13:51
Logger Library with winston
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
@bgschiller
bgschiller / Makefile
Created December 13, 2013 04:03
A thread-based pseudorandom number generator, and two adversaries that defeat it. Code for the blog post at http://brianschiller.com/blog/2013/12/12/pthreads-and-prngs-oh-my.html
all: thread_prng adversary Makefile advantages
thread_prng: thread_prng.c
gcc --std=c99 -o thread_prng -lpthread thread_prng.c
adversary: adversary.c
gcc --std=c99 -o adversary adversary.c
advantages: adversary thread_prng
for option in r m; do \