Skip to content

Instantly share code, notes, and snippets.

@rtomayko
rtomayko / MikeClock.java
Created April 7, 2012 23:57
Digital Clock Java applet from 1996 written by none other than @mperham
/*
* Digital Clock Java applet 06/27/96
* by Mike Perham mperham@cs.cornell.edu
*
* Blinks the colon every second; refreshes time
* every minute. Futuristic LED display. Generally nifty.
*
* Array digit[] holds a bitmask of which LEDs each number
* lights up: digit[1] = 6 because it lights up the 2nd
* and 3rd LEDs.
This time bay-beee i'll beeeeeeEEEEEEEEEeeeee - BullehhhhhhhhhhhhhhhT PROOOF.
@rtomayko
rtomayko / latency.txt
Created June 1, 2012 00:43 — forked from jhclark/latency.txt
Latency numbers every programmer should know
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory
@rtomayko
rtomayko / gist:1202895
Created September 8, 2011 08:11
The Sazerac
You'll need:
- Old Fashioned glasses, two of
- Sugar cubes, two of
- Peychaud's Aromatic Cocktail Bitters, one bottle of
- Ice, enough to fill both glasses
- Water, one oz of
- Rye whisky, two oz of
- St. George Absinthe Verte, 0.333oz of
- Lemon, one twist of
.__ ___. .__ __ .__ .___
| |__ _____ ______ ______ ___.__. \_ |__ |__|_______ _/ |_ | |__ __| _/_____ ___.__.
| | \ \__ \ \____ \ \____ \< | | | __ \ | |\_ __ \\ __\| | \ / __ | \__ \ < | |
| Y \ / __ \_| |_> >| |_> >\___ | | \_\ \| | | | \/ | | | Y \/ /_/ | / __ \_\___ |
|___| /(____ /| __/ | __/ / ____| |___ /|__| |__| |__| |___| /\____ | (____ // ____|
\/ \/ |__| |__| \/ \/ \/ \/ \/ \/
_____ ___ ___ ___ ___ ___
/ /::\ / /\ / /\ /__/\ /__/\ /__/| ___
/ /:/\:\ / /:/_ / /:/_ \ \:\ \ \:\ | |:| / /\
/ /:/ \:\ / /:/ /\ / /:/ /\ \ \:\ \ \:\ | |:| / /:/
#!/bin/sh
# Sat Apr 24 20:33:56 PDT 2010
# This file was generated by rpg-config on behalf of rtomayko
# Remove comment characters and edit values to change the default config
# rvm environments share index, packs, and gem cache directories.
test $(id -un) != root && {
RPGINDEX=~/.rpg/index
RPGPACKS=~/.rpg/packs
@rtomayko
rtomayko / gist:814024
Created February 7, 2011 05:11
sample of github git fetch times by protocol
$ uname -a && git --version
Darwin asha.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
git version 1.7.2.1
$ git clone git://github.com/github/gitignore.git
$ cd gitignore
$ # fetching over ssh
$ yes | head -5 | (while read ; do time git fetch git@github.com:github/gitignore.git; done) 2>&1 | grep real
real 0m2.103s
@rtomayko
rtomayko / jquery-hotload.js
Created August 6, 2010 06:07
hotload jquery
// paste this into firebug or chrome console or whatever
// to load jquery into pages that dun have it
j=document.createElement("SCRIPT");
j.src="http://code.jquery.com/jquery-latest.pack.js";
document.getElementsByTagName("HEAD")[0].appendChild(j);
@rtomayko
rtomayko / bacon
Created May 17, 2010 23:31
bacon(1)
#!/bin/sh
# Usage: bacon <file>
# Upload <file> to baconfile.com and copy URL to pasteboard.
#
# You baconfile.com credentials must exist in ~/.netrc, like this:
#
# machine baconfile.com
# login garfield
# password ironman04
#
@rtomayko
rtomayko / unicorn_github
Created May 17, 2010 19:56
GitHub RailsBench GC settings
#!/bin/sh
# Usage: unicorn_github
# Script used to start unicorn in GitHub staging and production environments.
# This is called primarily by god.
set -e
# configure GC settings
export RUBY_HEAP_MIN_SLOTS=800000
export RUBY_HEAP_FREE_MIN=100000
export RUBY_HEAP_SLOTS_INCREMENT=300000