Batch Change File Extensions

Change file extensions en masse with this easy line of code:

for f in *.txt; do base=`basename $f .txt`; mv $f $base.md; done

Perfect…

Regular Expression for Parsing Phone Numbers

This regular expression will parse most phone numbers into four groups: country code, area code, number, and extension. It works most of the time, see the examples below…

Textmate-like fuzzy finder in RubyMine

I just discovered, after months of RubyMine use, that the GoTo functions work like fuzzyfinder in Textmate. There are a lot of useful shortcuts under the GoTo menu; the ones I am finding most useful are Ctrl+Shft+N for finding and opening a file, Ctrl+N for a class, and Alt+Shft+N for jumping to a corresponding Rails object. For instance, if I am in the People controller, I can jump to the Person model, People views, etc, bringing me that much closer to fulfilling my dream of never having to leave the keyboard when developing.

Google+

Yesterday was my birthday, and — what do you know? — I got an invitation to join Google+. Pretty exciting! I was one of the first of my friends to get on, so I had the opportunity to invite a lot of my buddies and colleagues. My inbox stayed full today with notices from Google that another one of my contacts had joined the network, and would I like to add her to one of my circles. Circles, by the way, are what sets Google+ apart from other services in this space. As a friend pointed out today, Google+ is kind of like a combination of Twitter and Facebook. You don’t friend people like in Facebook; you follow them like on Twitter. Come to think of it, all day people have been comparing Google+ to Facebook, but it’s actually a lot more like Twitter than one would think at first glance…

Starting My Blog Over with Jekyll

I started using Wordpress to design my blog because I like the all the free stuff I got out of the box. It is definitely the best turn-key blogging software solution out there — at least it was when I set up my site a year or so ago. What I really liked about Wordpress was the plethora of nice looking, free themes out there. It was really easy to set up a cool looking blog in just a few minutes…

Installing PostgreSQL-8.2 on Ubuntu 10.04

First, add the Hardy repositories to apt-get sources. If this file does not already exist, create it.

sudo vim /etc/apt/sources.list.d/hardy.list

Recursively Delete .svn Directories

Finding all the .svn directories is easy

$ find . -type d -name .svn
./.svn
./sourceA/.svn
./sourceB/.svn
./sourceB/module/.svn
./sourceC/.svn

Now use command substitution with rm -rf.

rm -rf `find . -type d -name .svn`

Note the use of the backtick symbol (located under the