Code examples in Keynote

Here is a quick oneliner for adding hightlighted code into the clipboard in os x:

source-highlight -d -i CodeExample.java -o STDOUT |textutil -convert rtf -stdin -stdout | pbcopy

After running the above command, you can simply paste the code into Keynote, and probably other programs as well.

This depends on source-highlight which can be installed using homebrew:

brew install source-highlight

Converting mkv to other formats on the mac

To play mkv video on the ps3 I use two small scripts called mkv2ts and mkv2m4v which converts to m2ts and m4v (mp4)
The mp4 video can also be used on Apple gadgets like the iphone/ipad/apple tv.

These scripts uses the following command line tools:

Here are my scripts:

http://dl.dropbox.com/u/150120/mkv2m4v

http://dl.dropbox.com/u/150120/mkv2ts

The original scripts can be found here:

mkv2m4v - https://gist.github.com/619933/

mkv2ts - http://forum.doom9.org/archive/index.php/t-137517.html