Skip to content

Instantly share code, notes, and snippets.

View mooman219's full-sized avatar
🐄

mooman219

🐄
View GitHub Profile
@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 21, 2024 06:32
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@weswigham
weswigham / method_missing.lua
Created November 5, 2013 04:33
You've always wanted method_missing in lua, right? This is a pretty close approximation.
--[[
Method missing should be an optional definition on any object.
If a method cannot be found, method_missing is called if available
]]
local field = '__method__missing'
function method_missing(selfs, func)
local meta = getmetatable(selfs)
@Thinkofname
Thinkofname / gist:5110835
Last active September 23, 2019 23:29
0x3F Particle list
hugeexplosion
largeexplode
fireworksSpark
bubble
suspended
depthsuspend
townaura
crit
magicCrit
smoke
@jboner
jboner / latency.txt
Last active May 6, 2024 07:06
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