Skip to content

2007

Pretty Code Samples in Presentations

Today is deprec day (well, the start of a deprec long weekend actually!).

I started the day with some procrastination. I decided to learn how to make super awesome eyecandy ruby slides in Keynote. I love presentations that include code samples and want to be able to make mine look good with as little effort as possible.

First I installed a Textmate bundle called Copy as RTF that copies a selection to the clipboard while preserving syntax highlighting and optimizing font size for pasting into Keynote.

Then I found the ultimate pretty font (slides 14 + 15) but can't work out it is. I tried all the fonts on my MacBookPro to no avail. Then it occurred to me that I want a fixed width font to display code. And my Mac has only four of them: Monaco (which is the default for textmate), Courier, Courier new and Andale Mono.

Make Resourceful Slide

So what font have they used?

update - I found the font! It's Sunday night and I decided to have another crack at matching the font. Adobe Reader lists the fonts used under 'Document Properties'. There's a Textmate page listing alternative fonts. Guess what? BitstreamVeraSans and DejaVuSans are listed in both the document properties and the list of free fonts! I installed both and I reckon the winner is DejaVuSans-mono (download).

I got my Apple MacBookPro using this font by copying it to /System/Library/Fonts.

update 2 I had a problem with CopyasRTF. When pasting onto a black background in Keynote, all white text is turned black. I managed to fix this by changing the default color_index to 45 (from 0) as shown below.

unless new_style[:color_index]
  new_style[:color_index] = 45
end

Enable SSH agent forwarding for Capistrano

Having to repeatedly enter passwords is a drag. And enabling password based SSH login to your SVN servers is a security risk. So I'm pretty excited that Chris Andrews implemented SSH agent forwarding into net-ssh-1.1.0.

Update to the latest version of net-ssh with:

$ sudo gem update net-ssh

To enable it, put the following into your ~/.caprc:

ssh_options[:forward_agent] = true

This stopped me getting prompted for a password by my subversion every time I ran 'cap deploy'.

Integrating Wordpress into a Ruby on Rails site

The first question you'll probably ask is why I didn't go with typo or mephisto. While I have to admit I haven't tried them myself, I decided to use WordPress based on the maturity of the software and size of the userbase. I think this is a pragmatic choice for a piece of software I want to use on my site.

WordPress has a nice feature packed management interface. It also supports themes and I found I could customize it to fit in with my site without editing any of the files that come with the main distribution. This means I can automate upgrading of WordPress when future versions (with security fixes) are released.