Switching Ruby on Rails development to Snow Leopard

Just a couple of random notes on switching to Snow Leopard.

taf2-curb gem

Compiling taf2-curb also requires (like memcached does) a custom environment flag:

sudo port install curl
sudo env ARCHFLAGS="-arch x86_64" gem install taf2-curb

Subversion bundle in TextMate

I didn’t quite work out all the issues with TextMate's Subversion bundle, but at least CommitWindows pops up (I still can’t revert changes). Setting TM_RUBY variable to /usr/bin/ruby (for default Snow Leopard Ruby) in Properties / Advanced / Shell Variables tab fixes this issue.

Compiling memcached gem on Snow Leopard

For production at Blip we’ve recently switched from memcache-client to Evan Weaver’s memcached gem (performance!). Compiling it on Snow Leopard for development requires ARCHFLASH to be set to -arch x86_64.

To fix this just uninstall and reinstall memcached:

sudo gem uninstall memcached
sudo env ARCHFLAGS="-arch x86_64" gem install memcached<

And you’re done!

Using tunnelblick with Snow Leopard

I lost quite some time figuring out how to run tunnelblick on Snow Leopard.

As opposed to common sense - you should not use the latest builds (3.0b18, 3.0b16 - at the time of writing this post) of tunnelblick. I’ve managed to successfully connect to my VPN with tunnelblick 3.0b14.

Using Windows keyboard in OS X Leopard

Since sometimes I’m awfully lazy - I got myself a second keyboard, just for the sake of not having to carry one to office and back. At home I use my beloved Apple Keyboard, while at work - a crappy, no-name, ten-bucks-a-piece one (it does it job, though!).

However, since at work I use a Windows keyboard I had a problem with the switched Option / Command keys. I’ve tried DoubleCommand, however I had to click through the System Preferences each time I switched my keyboard. Couple of minutes of googling and a nice script popped out. However, it was useless in OS X Leopard, so I made a couple of quick changes and here’s something I came up with. First, switch-to-windows-keyboard script:

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
	get properties
	tell process "System Preferences"
		click button "Modifier Keys…" of tab group 1 of window "Keyboard & Mouse"
		click pop up button 2 of sheet 1 of window "Keyboard & Mouse"
		delay 0.3
		click menu item 4 of menu 1 of pop up button 2 of sheet 1 of window "Keyboard & Mouse"
		delay 0.3
		click pop up button 1 of sheet 1 of window "Keyboard & Mouse"
		delay 0.3
		click menu item 3 of menu 1 of pop up button 1 of sheet 1 of window "Keyboard & Mouse"
		delay 0.3
		click button "OK" of sheet 1 of window "Keyboard & Mouse"
	end tell
end tell
tell application "System Preferences"
	quit
end tell

Second, back-to-apple-keyboard script:

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
	get properties
	tell process "System Preferences"
		click button "Modifier Keys…" of tab group 1 of window "Keyboard & Mouse"
		click button "Restore Defaults" of sheet 1 of window "Keyboard & Mouse"
		click button "OK" of sheet 1 of window "Keyboard & Mouse"
	end tell
end tell
tell application "System Preferences"
	quit
end tell

You might ask why not use Ryan Block's script? Well, since I rely heavily on QuickSilver I also created two Platypus applications - one for each script. I’m a keyboard user, so I didn’t like the clicking on the Macintosh / PC screen. Touching your mouse is evil.

Fluid's Google Reader Fix

For quite a few weeks I’ve been using Fluid with Google Reader - having a standalone WebKit based application with dock notification works great for me. However, one thing has been bothering me - Fluid never clears the dock badge when all the items are read. I’ve just posted a little fix for this issue - grab it at http://userscripts.org/scripts/show/23422.

Let me know if this works for you!