[localhost:~]$ cat * > /dev/ragfield

Wednesday, October 21, 2009

Play a specific track in iTunes from Mathematica

A coworker was making a presentation and asked me for a function he could trigger with Button[] to start playing a specific track in iTunes (on a Mac). This gets the job done:
iTunesPlay[playlist_String, track_Integer] := Run[StringJoin[
        "osascript -e 'tell application \"iTunes\" to play track ",
        ToString[track], " of user playlist \"", playlist, "\"'"
iTunesPlay["Mix", 1]
iTunesPlay["Mix", 2]

Thursday, October 8, 2009

Use BBEdit for diffing with Mercurial

Add the following lines to your ~/.hgrc file:
hgext.extdiff =

cmd.bbdiff = bbdiff
opts.bbdiff = --resume --wait --reverse
Then diff with the bbdiff command:
$ hg bbdiff [...]