Skip to content

Instantly share code, notes, and snippets.

@6D65
6D65 / dabblet.css
Created April 18, 2012 08:54
The first commented line is your dabblet’s
/**
* The first commented line is your dabblet’s
*/
::selection { background: brown; color: white; }
html {
background: #f06;
background: linear-gradient(270deg, whitesmoke, white);
min-height: 100%;
}
@6D65
6D65 / dabblet.css
Created April 20, 2012 12:16
The first commented line is your dabblet’s
/**
* The first commented line is your dabblet’s
*/
::selection { background: brown; color: white; }
html {
background: #f06;
background: linear-gradient(270deg, whitesmoke, white);
min-height: 100%;
}
@6D65
6D65 / emacs-cheat-sheet.md
Created August 20, 2012 18:50 — forked from dherman/emacs-cheat-sheet.md
My emacs cheat sheet

In penance for cracking stupid jokes on Twitter, here's my Emacs cheat sheet. Emacs has a steep learning curve, so I've tried to order them by importance so you could learn them in stages.

One overall rule of thumb: pay attention to the minibuffer (the line at the bottom of the editor). It will often guide you through a process, and also gives you hints about what state you're in, such as the middle of a multi-chord sequence.

The other rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.

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

@6D65
6D65 / latency.txt
Created December 26, 2012 12:09 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
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 4K randomly from SSD* 150,000 ns 0.15 ms
@6D65
6D65 / gist:4463044
Created January 5, 2013 18:51 — forked from marick/gist:879674
(use 'clojure.contrib.monads)
(defn new-pair [value log] {:value value :log log})
(defn starting-pair [value] (new-pair value nil))
(defn log [base-value]
(fn [log]
(new-pair base-value (cons base-value log))))
(defmonad logging-m
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
/**
* How to have floating scrollbars in Firefox (Linux, Windows & Mac).
* Screenshot: http://i.imgur.com/bn44L.png
* You need Firefox > 18. Just run this code in a browser-scratchpad:
*
* Ping me on Twitter (@paulrouget) if you run into problems.
*
* 1. Go to about:config - Set devtools.chrome.enabled to true
* 2. Starts Scratchpad (Shift-F4)
* 3. In Scratchpad's menubar, check "Environment > Browser"
@6D65
6D65 / ffi_error.txt
Created September 20, 2015 07:11
ffi issue with nodejs
> ref@1.1.2 install /home/user/work/personal/project/c_client/node_modules/ffi/node_modules/ref
> node-gyp rebuild
make: Entering directory `/home/user/work/personal/project/c_client/node_modules/ffi/node_modules/ref/build'
CXX(target) Release/obj.target/binding/src/binding.o
In file included from /home/user/.node-gyp/4.0.0/include/node/node.h:42:0,
from ../src/binding.cc:6:
/home/user/.node-gyp/4.0.0/include/node/v8.h:336:1: error: expected unqualified-id before 'using'
/home/user/.node-gyp/4.0.0/include/node/v8.h:469:1: error: expected unqualified-id before 'using'