Skip to content

Instantly share code, notes, and snippets.

@nwjsmith
nwjsmith / gist:3657103
Created September 6, 2012 15:02 — forked from amateurhuman/gist:2005745
Installing Rubinius 2.0.0-dev with rbenv

Installing rbx-2.0.0-dev with Ruby 1.9 support using rbenv can be a tad tricky. This is what I did to get up and running, you'll need another version of ruby already installed as well as rake.

The basic outline:

  1. Clone Rubinius HEAD from github
  2. Configure installation for rbenv and 1.9 support
  3. Install Rubinius
  4. Configure your $PATH to use Rubinius gems
  5. Start using Rubinius
@nwjsmith
nwjsmith / latency.txt
Created June 5, 2012 14:44 — 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
@nwjsmith
nwjsmith / middleware.rb
Created September 8, 2011 13:55 — forked from skippy/middleware.rb
delete vagrant vm's chef client and node from chef server on destroy
class OnDestroyMiddleware
def initialize(app, env)
@app = app
end
def call(env)
env["config"].vm.provisioners.each do |provisioner|
env.ui.info "Attempting to remove client #{provisioner.config.node_name}"
`knife client show #{provisioner.config.node_name}`
if $?.to_i == 0
@nwjsmith
nwjsmith / proc_composition.rb
Created September 22, 2010 18:12 — forked from headius/proc_composition.rb
Composable procs
class Proc
def <<(other)
case other
when Proc
Proc.new do |*args|
call(other.call(*args))
end
else
call(other)
end

Writing Commit Messages

One line summary (< 50c)

Longer description (wrap at 72c)

Summary