Skip to content

Instantly share code, notes, and snippets.

@matthewtodd
matthewtodd / database.rb
Created August 6, 2010 12:05
heroku rake db:pull --remote staging
require 'heroku'
require 'taps/operation'
class Database
def self.pull(*args)
new.pull(*args)
end
def initialize(uri=ENV['DATABASE_URL'])
@uri = uri
@matthewtodd
matthewtodd / gist:728014
Created December 4, 2010 07:34
Resize an OSX display with RubyCocoa.
require 'osx/cocoa'
class Screen
class << self
def resize(width, height, &block)
new.resize(width, height, &block)
end
end
def initialize(screen = OSX::CGMainDisplayID())
@matthewtodd
matthewtodd / tmux
Created January 27, 2011 11:30
script/tmux
#!/bin/sh
tmux start-server
if ! $(tmux has-session -t grow); then
tmux new-session -d -s grow -n foreground
tmux send-keys 'cd .' C-m C-l
tmux send-keys 'AUTOFEATURE=true autotest --quiet' C-m
tmux split-window -h
tmux send-keys 'cd .' C-m C-l