Skip to content

Instantly share code, notes, and snippets.

View altamic's full-sized avatar

Michelangelo Altamore altamic

View GitHub Profile
# deploy.rb
require 'yaml'
APP_CONFIG = YAML.load(File.read(RAILS_ROOT + "/config/app_config.yml"))
default_run_options[:pty] = true
set :user, APP_CONFIG['user']
set :domain, APP_CONFIG['domain']
set :application, APP_CONFIG['application']
What is this life if, full of care,
We have no time to stand and stare.
-- from "Leisure," by W.H. Davies
initializer "time_formats.rb",
%q{def quarter(month)
(((month - 1) / 3) + 1) if (1..12).member? month
end
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[:quarter] = lambda { |time| time.strftime("Q#{quarter(time.month)}-%y") }
}
# ~/.irbrc file
# From http://giantrobots.thoughtbot.com/2008/12/23/script-console-tips
require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize
# Easily print methods local to an object's class
class Object