Change Rails Environment when running scripts
Always seem to forget this and take ages finding it again
RAILS_ENV=production script/...
AASM gotchas
This one really got me!!
Whats wrong with the following
class Order < ActiveRecord::Base
include AASM
aasm_initial_state :customer
aasm_column :state
aasm_state :address
aasm_event :set_user do
transitions :from => :customer, :to => :address
end
end
Turn of Tabs in Textmate
God it took me a long time to find this again ...
If you want to you can disable tabs from the command line. Make sure TextMate isn't running, and then type:
defaults write com.macromates.textmate OakProjectWindowShowTabBarEnabled false
into the terminal. To bring tabs back, you'll have to:
defaults delete com.macromates.textmate OakProjectWindowShowTabBarEnabled
Winmerge for OSX
Slightly spurious title as there is absolutely no need for a winmerge for OSX. Included with the Developer Tools for OSX is filemerge, which is an excellent diff tool. There is also a tool to call it from a terminal called opendiff so you can do
opendiff dir1 dir2
opendiff file1 file2
You can also find filemerge using spotlight.