This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write | |
http://trollop.rubyforge.org/ | |
helps provide - short options, long options, switches with on and off | |
$PROGRAM_NAME = '..' | |
exit <code> | |
Man | |
http://rubygems.org/gems/gem-man |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo du ./* | sort -n -r | head -n 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%s/Started GET "\/assets.*$/ | |
%s/Served asset.*$/ | |
%s/MONGODB.*$/ | |
%s/\n\n\+/\r | |
" also as a vim function: https://github.com/dira/vimfiles/commit/8fe83043e73cff19a52ed6b43a6261019f32cf19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# want to nest `Video` under `Media`; had a `videos` collection | |
# rename the collection: | |
Mongoid.database.drop_collection('videos') | |
Mongoid.database.rename_collection('videos', 'media') | |
# or | |
Mongoid.database.collection('videos').rename('media') | |
# change the type of all the existing records |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert black & white image with aliasing such as all black & black-ish pixels have another color | |
# which means: change all pixels that are not-white | |
convert -fill "#2CD152" +opaque white black-grey-and-white.png green-and-white.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install http://mxcl.github.com/homebrew/ | |
# install iterm2 | |
# install macvim | |
# install zsh | |
# make zsh default | |
chsh -s $(which zsh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
config.middleware.use 'StoreRedirectTo' | |
# and make sure you autoload the contents of /lib | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http_proxy '10.2.2.1', 8888 | |
# the ones inspired by the documentation do not work | |
# http_proxy 'http://10.2.2.1', 8888 | |
# http_proxy 'http://localhost', 8888 | |
# http_proxy 'http://127.0.0.1', 8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
railroady -M -i -t -o models.dot; dot -Tpng models.dot > models.png; open models.png | |
railroady -C --hide-private --hide-protected -o controllers.dot |