Skip to content

Instantly share code, notes, and snippets.

View seanami's full-sized avatar

Sean McBride seanami

View GitHub Profile
@seanami
seanami / keybase.md
Created September 26, 2014 00:53
keybase.md

Keybase proof

I hereby claim:

  • I am seanami on github.
  • I am seanami (https://keybase.io/seanami) on keybase.
  • I have a public key whose fingerprint is 9657 DEF8 460D F794 08A1 68F3 A86C E544 C9FB 5B99

To claim this, I am signing this object:

@seanami
seanami / sinatra_erb_block_helper_test.rb
Created July 28, 2010 23:24
If you're using Sinatra with ERB and you want to write helpers that take blocks, you need a little bit of magic that other more complex frameworks provide for you (capture). Here's a really really simple example.
require 'rubygems'
require 'sinatra'
require 'erb'
helpers do
def buffer()
@_out_buf
end
def capture(buffer)
pos = buffer.size