How to remove duplicate entries in Finder menu
Type in console:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
and then:
killall Finder |
Ruby, Rails and something else
Type in console:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
and then:
killall Finder |
If you want iTerm2 to behave like the other Mac OSX applications, so that alt + left moves the previous word, alt + right moves to the next word and alt + backspace deletes the whole word, add these keyboard shortcuts from iTerm > Preferences > Profiles > Keys:
Let’ say you need to debug this piece of code:
very_cool_method(egg, sausage) |
What would you do? I guess something along the lines of:
spam = very_cool_method(egg, sausage) p spam |
Well, Ruby 1.9 let you do something cooler instead:
very_cool_method(egg, sausage).tap{ |s| p s } |
The cool thing about tap is that you can use it to eavesdrop method chains:
very_cool_method(egg, sausage).tap{ |s| p s }.now_make_sandwich_from(bacon) |
Hooray!
Simply type in rails console:
ActiveRecord::Base.logger = Logger.new(STDOUT)
If you want to install gems quickly without waiting for ri and rdoc documentation files, run this command:
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
Your new gems won’t include documentation at all. Hooray!