SCM workflow in TextMate

I’m loving coding in TextMate - it makes ruby much more fun. And python, too.

It integrates really well with heaps of other tools, including my diffing app of choice (Changes.app), and my preferred DVCS (Mercurial).

It even has its own Commit pane that appears when you choose to commit. There is one problem with it, however. Invariably I have made a change to a file and can’t remember exactly what it was. You can’t view the changes using the Mercurial bundle and Changes, and leave that window open while you commit. So, I end up having a terminal window open that I type hg chdiff into.

Instead, we should be able to quickly see the changes made to the working copy. Perhaps using a button like below:

Of course, that’s just a mockup (although it is done in IB) - the button is not connected up to anything. I have no idea how to reverse engineer the Commit.app to do this. But it would be cool.

Update: It appears all you have to do is tell the CommitWindow.app tool that you want to use --diff-cmd "hg,diff", and it is all done.

Dr Seuss

Dr Seuss.png

Safari 4 Busy Icon

The active tab looks wrong.

Inactive tabs not so much.

Safari_Loading_icon.png

Limiting SQL Alchemy queries

Note for future reference: especially since the data migration script I was running today was running out of memory and crashing.

You can use slice notation, which limits the query:

>>> for p in db.query(Person)[:10]:
...   print p

This rocks.

Star Wars Videos

Star Wars: Retold (by someone who hasn’t seen it) from Joe Nicolosi on Vimeo.

Star Wars: The Crazy Ones (via retrophisch).

Jailbait

Jailbait.png

Songsmith

Finally, Microsoft put out something worth downloading, and it won’t install on my VMWare machine:

Songsmith.png

Goals for 2009

What am I hoping to achieve in the coming year?

  • Learn two new languages: at this stage it looks like it might be two of Haskell, Ruby and Icon. Probably the first two.
  • Play in the National Touch League. Over 30s, but still the highest competition in the world.
  • Finish this degree, start the next. I’m hoping to get a headstart on my Honours degree, if they’ll let me.
  • Release some OS X software. I have three commercial programs in various stages of completion. I’m hoping to get one of them done and released.
  • Build a vegetable garden. Got the beds planned out - just need to make them.
  • Learn to type using a Dvorak key layout.
  • Reread SICP

I’m sure I’ll think of more things than this…

Tab completion and ssh/open -a

I use the Terminal just as much as the Finder, and have tab-completion turned on in bash. To make it better, you can set it so that it will complete differently depending upon what you have already typed in.

The first one of these tips will autocomplete from the ~/.ssh/known_hosts file, so that when you type in:

$ ssh ma[tab]

complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh

it will autocomplete the servers you ssh to that start with “ma”.

The next one is more complicated - it allows you to complete from all available applications when typing:

$ open -a [tab]

complete -W "$(/bin/lsregister -dump | /usr/bin/sed -E -n -e '/\/Applications/{s/^.+ ((\/Applications|\/Developer).+\.app)$/\1/p;}' | \/usr/bin/sed 's/ /\\ /g' | \/usr/bin/sed -e s/\'/\\\\\'/g | /usr/bin/xargs /usr/bin/basename -s '.app' | /usr/bin/sed 's/ /\\\\\\ /g')" open -a

These can be added to one of your bash startup files: mine live in ~/.bashrc.

What's Open Flaws

First thing I did when looking at a new site: What’sOpen.com.au (although, I think the apostrophe isn’t there in the domain name!), search for some results.

Geez, I’d be pissed if I were the first hit in the list.

whatsopen.png

It’s a bit scaled, but on Safari, the first item is almost totally obscured by the header graphic.

Oops.