← back to the blog
fousa tag
Current tag: tag
2010
Other stuff in Ruby 1.9
TAB When you want to output each value of an array while returning the same array. prices = [1, 2, 3] prices.tab { |price| puts price } This is not that special, but you could do some chaining with other methods. prices.tab { |price| puts price }.select { ... } Could come in handy when debugging your application. INSTA...
My Git integration with Terminal
The following scripts are added to my ~/.bash_profile for some Git integration. BRANCH AUTOCOMPLETION This piece of code autocompletes the branches when you press TAB. So "git checkout ma" and press TAB, will result in "git checkout master". _complete_git() { if [ -d .git ]; then branches=`git branch -a | cut -c 3-` tags=`git ta...