Skip to content

Instantly share code, notes, and snippets.

cd /Applications/TextMate.app/Contents/SharedSupport/Bundles
svn co "http://svn.textmate.org/trunk/Bundles/Ruby Haml.tmbundle"
svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby Sass.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'
##
# Our Mailer is TFB, and thus I've brought the concerned_with pattern in to kick ass.
# Adapted from: http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model
#
class << ActionMailer::Base
def concerned_with(*concerns)
concerns.each do |concern|
require_dependency "#{name.underscore}/#{concern}_mailer"
end
end
#! /usr/bin/ruby
# Ever update/reinstall ruby and need to bring all your old gems,
# including old versions to the new environment? Just output your
# gem list to gem_list.txt and run it through this script.
install_all = false
File.open("gem_list.txt").each do |line|
# coderay (0.8.273, 0.8.260, 0.7.4.215)
match_data = /(\w+) \((.+)\)/.match(line)
# Ruby gems always available
RUBYOPT="rubygems -Ilib:test"
export RUBYOPT
# Specific rewrite rules for blog traffic
<Directory /server/directory/to/app/current/public/blog>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</Directory>
def run_tests(test_type)
case test_type
when :all
system('rake test')
when /(controllers|functional)\/?/
system('rake test:functionals')
when /(models|unit)\/?/
system('rake test:units')
else
# do nothing...
On the old computer, copy ~/Music/iTunes to an external drive or however you'll get it to
the new computer.
On the new computer, rename ~/Music/iTunes to ~/Music/iTunes.bak
Copy iTunes folder from old computer to new one, placing it at ~/Music/iTunes
Make sure your media external hard drive is plugged into the new computer.
Open iTunes.
Vacation to the amazing Ritz-Carlton, Amelia Island, Florida.
Then it goes downhill from:
o Our GPS led us to the airport along the coast. Then it said,
"take next left and board ferry."
o Arrive at gate in JAX. Flight already delayed 35 minutes.
o Due to delay, we only have 60 minutes to make connection in O'Hare.
o We're nervous and want to talk to someone. Gate attendant
does not arrive until about 30 minutes before we're due for takeoff.
o Gate attendant promptly proclaims they can turn it around faster
$ curl https://github.com/atmos/cinderella/raw/master/bootstrap.sh -o - | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
106 1175 106 1175 0 0 2677 0 --:--:-- --:--:-- --:--:-- 15259
Ensuring we have the latest version of cinderella installed
Cinderella installed successfully
sh: line 23: cinderella: command not found
sh: line 23: cinderella: command not found
sh: line 23: cinderella: command not found
Run started Thu Nov 4 22:21:23 CDT 2010
#
# Cookbook Name:: ruby
# Recipe:: default
#
DEFAULT_RUBY_VERSION = "1.8.7-p248"
script "installing rvm to ~/Developer" do
interpreter "bash"
code <<-EOS