the intellidiot

(-: Bratish Goswami writes his thoughts and takes on whatsoever :-)

Open All Edited and Uncommitted Files in a Single Command

At the begining of my daily coding job I often find myself in a situation when I got to start with the files edited the previous day. If it's a lenthy feature and many files are touched, most of the times I use git status to check the updated files and start opening them one by one in Textmate. Not a complex task at all but seems boring to me. I decided to spend some time to automate this.

And the following is the single line shell script I came up with.

(mate .;set -v off;for line in $(git status --porcelain|awk '$0=$NF' FS=' ');do;mate $line;done)

This will fire up the TextMate and the opens all the edited or newly created files shows up in git status list.

Posted

I'm Speaking at RubyConf India 2011

I'm speaking at RubyConf India 2011

We all are very excited for RubyConf India 2011 here in CastleRockResearch.

Looking forward for a great weekend on May 28th and 29th 2011 :)

Posted

A Little Ruby Obfuscated Snippet

My employer was looking for some cool idea for company's tagline and T-shirt prints for upcoming RubyConfIndia.

Here's what I came up with: a small obfuscated ruby snippet showing abbreviated organization name as an ascii art and outputs the endearing nickname as a string.


Posted

A `tail -f` implementation in Node.js

tail -f is pobably one of the most used commands for a web developer. While learning stuffs about Node.js I thought of writing my own version of tail -f in with the support of advanced non-blocking libraries.

Posted

exit = "don't exit" in IRB :)

To close your IRB session you commonly type

exit
and hit <enter>.

Now put

exit = "don't exit"
. Trying with exit will now print
"don't exit"

How'll you exit then? Well, the other options you have are

quit OR CTRL + z
If you really want to quit using
exit
command then use
exit()

In ruby the parenthesis is optional for a method call. But if a namesake variable exists then it'll get the priority. You have to use the parenthesis to call the method in this scenario.

Posted