Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active April 18, 2025 00:24
Google Maps + D3
license: gpl-3.0
@jch
jch / tail.rb
Created October 11, 2010 18:39
nspipe example
framework 'cocoa'
outpipe = NSPipe.pipe
task = NSTask.alloc.init
task.setLaunchPath '/usr/bin/tail'
task.setArguments %w(-f -n10 /Users/jch/projects/pharmmd/log/wendy.log)
task.setStandardOutput outpipe
file = outpipe.fileHandleForReading
@vangberg
vangberg / README
Created February 22, 2009 01:06
Deploying a Sinatra app to Heroku
# Deploying a Sinatra app to Heroku
## Database
The location of the database Heroku provides can be found in the environment
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example
on how to use this.
## Server
Heroku is serving your apps with thin, with means you have all your thin goodness available,
such as EventMachine.
@mislav
mislav / gist:17371
Created October 17, 2008 07:42
haml2erb
class ErbEngine < Haml::Engine
def push_script(text, preserve_script, in_tag = false, preserve_tag = false,
escape_html = false, nuke_inner_whitespace = false)
push_text "<%= #{text.strip} %>"
end
def push_silent(text, can_suppress = false)
push_text "<% #{text.strip} %>"
end
end