This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'osx/cocoa' | |
class Screen | |
class << self | |
def resize(width, height, &block) | |
new.resize(width, height, &block) | |
end | |
end | |
def initialize(screen = OSX::CGMainDisplayID()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'heroku' | |
require 'taps/operation' | |
class Database | |
def self.pull(*args) | |
new.pull(*args) | |
end | |
def initialize(uri=ENV['DATABASE_URL']) | |
@uri = uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensure AssetTagHelper has been loaded before we try to monkey-patch it. | |
require 'action_view/helpers/asset_tag_helper' | |
module ActionView::Helpers::AssetTagHelper | |
# Insert the asset id in the filename, rather than in the query string. In | |
# addition to looking nicer, this also keeps any other static file handlers | |
# from preempting our Rack::StaticCache middleware, since these | |
# version-numbered files don't actually exist on disk. | |
def rewrite_asset_path(source) | |
source.insert source.rindex('.'), "-#{rails_asset_id(source)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Drop this script in ~/Library/Address Book Plug-Ins | |
-- Edit the path in the "do shell script" line | |
using terms from application "Address Book" | |
on action property | |
return "phone" | |
end action property | |
on action title for aPerson with aNumber | |
return "Dial with Google Voice" | |
end action title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU | |
# I use 2 different Heroku accounts, one for my own apps and one for Amani's. | |
# This script givens me a reasonable way to switch between them, with a little | |
# less typing than moving a symlink around. And I get to use abbrev! | |
require 'abbrev' | |
require 'pathname' | |
require 'yaml' | |
credentials = Pathname.new(ENV['HOME']).join('.heroku', 'credentials') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I've folded this idea into http://github.com/matthewtodd/shoe | |
# See what you think! | |
require 'rubygems' | |
require 'rubygems/doc_manager' | |
spec = Gem::Specification.new do |spec| | |
# ... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'appscript' | |
class DeployNotifier | |
include Appscript | |
def initialize(*names) | |
@ichat = app('iChat') | |
@accounts = names.map { |name| bonjour_account(name) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using terms from application "Mail" | |
on extractName from theRecipient | |
if the name of theRecipient exists then | |
return the name of theRecipient | |
else | |
return the address of theRecipient | |
end if | |
end extractName | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QEMU_IMG = '/Applications/Q.app/Contents/MacOS/qemu-img' | |
QEMU = '/Applications/Q.app/Contents/MacOS/i386-softmmu.app/Contents/MacOS/i386-softmmu' | |
directory 'tmp' | |
file '/tmp/ubuntu-cdrom' do | |
sh 'hdiutil attach vendor/ubuntu-8.10-server-i386.iso -mountpoint /tmp/ubuntu-cdrom' | |
end | |
file 'tmp/netboot' => ['config/preseed.cfg', 'config/pxelinux.cfg', 'tmp', '/tmp/ubuntu-cdrom'] do |
NewerOlder