Home
How to uninstall homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
set -e
cd `brew --prefix`
git checkout master
git ls-files -z | pbcopy
rm -rf Cellar
bin/brew prune
pbpaste | xargs -0 rm
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
test -d Library/LinkedKegs && rm -r Library/LinkedKegs
rmdir -p bin Library share/man/man1 2> /dev/null
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
rm -rf ~/Library/Logs/Homebrew
rm -rf /Library/Caches/Homebrew
16 Mar 2012
Use RVM with textmate
rvm wrapper 1.9.3 textmate
- Get textmate_ruby path by
which textmate_ruby
- Set env var
TM_RUBY={textmate_ruby path}
in textmate preferences
15 Mar 2012
How to use ruby to detect iPad
# Request from an iPhone or iPod touch? (Mobile Safari user agent)
def iphone_user_agent?
request.env["HTTP_USER_AGENT"] && request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/]
end
15 Mar 2012
Default logger level for environments
Logger level has:
logger.(debug|info|warn|error|fatal)
The default Rails log level is info
in production mode and debug
in development and test mode.
Since the log out put also consumed the system IO resource so please take care.
15 Mar 2012