This file contains hidden or 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
config_version 1.2 | |
snapshot_root /Volumes/Suspenders/ | |
no_create_root 1 | |
cmd_rm /bin/rm | |
cmd_rsync /opt/local/bin/rsync | |
cmd_logger /usr/bin/logger | |
interval nightly 3 |
This file contains hidden or 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 | |
# | |
# I have a couple of GeekTool windows at the bottom of the screen, | |
# where it's nice to bottom-justify their contents, but GeekTool | |
# doesn't seem to support this natively. | |
# | |
# Usage: | |
# cat TODO.rdoc | bottom-justify.rb 24 | |
# | |
# It seems like there could be a nice shell command for this, |
This file contains hidden or 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 'rubygems' | |
require 'action_controller' | |
require 'test/unit' | |
class AccountsController < ActionController::Base | |
end | |
# Your mission, should you choose to accept it: Change the RouteSet (in the | |
# with_route_set method) so as to make both tests pass. | |
class RoutingTest < ActionController::TestCase |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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)}" |
OlderNewer