Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/usr/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
# set the current account
function hset() {
ln -nfs ~/.heroku/credentials.$1 ~/.heroku/credentials
}
# get the current account
function hget() {
readlink ~/.heroku/credentials | awk -F . '{print $NF}'
}
desc "Minify the javascript output by sprockets"
task :minimize_js => :environment do
begin
File.new("public/sprockets.js")
rescue
Rake::Task['sprockets:install_script'].invoke
end
require "lib/js_minimizer"
js = IO.readlines("public/sprockets.js", '').to_s
@cdmwebs
cdmwebs / cdmwebs_rails.rb
Created October 13, 2009 20:32
My default Rails template with Authlogic and Cucumber
# Set up .gitignore
file '.gitignore', <<-CODE
config/database.yml
log/*.log
tmp/**/*
.DS\_Store
.DS_Store
db/test.sqlite3
db/development.sqlite3
/log/*.pid
chris@panthera:~/Sites/magazine$ script/console
Loading development environment (Rails 2.3.2)
>> a = User.last
User Load (0.4ms) SELECT * FROM "users" ORDER BY users.id DESC LIMIT 1
=> #<User id: 2, name: "Andy", created_at: "2009-05-19 18:39:53", updated_at: "2009-05-19 18:39:53">
>> a.current_magazine = Magazine.create(:title => 'Moustache Monthly')
Magazine Create (0.4ms) INSERT INTO "magazines" ("updated_at", "title", "created_at") VALUES('2009-05-19 18:42:55', 'Moustache Monthly', '2009-05-19 18:42:55')
NoMethodError: SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
#!/bin/sh
HOST=cdmwebs.homedns.org
SOURCE=/Users/chris
INCLUDE=/Users/chris/bin/include.txt
PATHTOBACKUP=/media/storage/backups/panthera
PIDFILE=/Users/chris/bin/rsync.pid
# No more changes.