ruby 'mind.rand' | awk '{ print $1 }'
Currently Browsing: ruby

Termite – a command line time tracker

Recently I felt the need to have some kind of time tracking tool, so I wrote a simple one in ruby. It requires only two gems to work (‘rubygems’ and ’sqlite3-ruby’). It is definitely a work in progress, but right now it is very easy to use and it gives reports for the last few days, last 3 weeks, and current month. Also, for mac users, it has the option to change your Adium statuses using...

ports wipe | homebrew + rvm

Recently I’ve heard about Max Howell’s homebrew and Wayne E. Seguin’s rvm from a friend (caffo), and hearing that they were both pretty cool, I decided to give them a shot. So if, like me, you are curious about these tools, I’ll post what I did to install them. First I made backups (by moving some folders around) mv ~/.gem ~/gems-old sudo mv /opt/local ~/macports-old You could also install...

ruby: print in the same line

I’ve always tried to make my scripts’ responses prettier and less crowded, and I came across something like the following piece of code, that helped me a lot lately #!/usr/bin/env ruby STDOUT.sync = true bars = ['/','-','\\','|'] i=1 while i do print "\rrunning #{bars[i%4]}" i += 1 sleep 1 end trap("INT") { print "\n\n" exit } If you like to see updates without flooding your terminal screen, this is...
Powered by Wordpress | Designed by Elegant Themes