nonstic Random snippets of mac and rails goodness

Mac OS X: (Finally,) An Easy Way to Copy the Full Pathname of a File or Folder

Every so often, I need to get the full pathname to a file or folder in Finder– usually to explain the location of a file about 17-levels-deep on a network drive somewhere.

Each time this happens, I cast about aimlessly on Google for several minutes, trying to find a quick solution. There are a few scripts/plugins/hacks kicking around, but they all seem to be written several years ago and not actively maintained. There are also several Finder replacements that have this functionality (yes, thanks ForkLift, you can sit down now), but I don’t want to replace Finder– I just need a quick way to get the full path to the file in question. In the end, I just write-the-darn-thing-out-by-hand, cursing each time I have to type a backslash (\) because i’ve got the key doubling as a forward-delete1.

Apparently macosxhints has known about this for almost a year already, but never told me about it. For those of you that also missed the memo, here is the secret:

  • Click-and-hold a file or folder
  • Open the Spotlight search bar (default: CMD+space)
  • Drop the file in the search field

Booyah– the full pathname to the file or folder, all highlighted and ready to copy to the clipboard.

  1. No, I can’t live without DoubleCommand 

Updating Gems for Rails 2.1 on Slicehost

As part of deploying a new app to my Slicehost account, I needed to update the Rails gem to 2.1. When I ran

sudo gem update

to update all my installed gems, the process just sat there. I waited patiently for 10 minutes, and then 15, but nothing ever happened. I thought maybe there was a temporary issue with the gems server, so I waited and tried again an hour later. Same result.

After doing some reading in the Slicehost forums, I learned this issue was sometimes caused by an old version of RubyGems itself, when trying to install newer gems. I first tried the suggestions on this page, regarding clearing clearing your gem cache, but to no avail.

So I manually updated to rubygems v1.2.0 as per this post and then ran a

sudo gem update --system

just to make sure everything was up-to-date. After this, the gem update ran as per normal, and all was good. Well, I had some issues with ImageMagick and RMagick, but that’s a story for another day.

iPhone 2.1 Firmware

As promised in Apple’s press even this past Tuesday, the iPhone 2.1 firmware appeared this morning. A bunch of new features, mostly related to reliability and speed, but the two I was most interested in were:

  • significantly improve battery life for most users
  • dramatically reduced time to backup to iTunes

How can a firmware update improve battery life? I suspect the main improvement will be the proper termination of background processes upon returning to the home screen. The iPhone device can generally1 be thought of as a one-application-at-a-time system. When you hit the home button to return to the main screen, the current application should be terminated.

In practice, this didn’t seem to always happen.

Although battery life on the iPhone is on the order of hours rather than days, i’m not in a 3G area, so i generally make it to the end of the day with at least 1/3 of my battery life remaining.

Several times in the last few weeks, my iPhone was suddenly showing red shortly after lunch. In these cases, I suspect an application was not properly terminated and kept operating in the background, wasting CPU cycles and sucking battery life. This effect could be exacerbated if the application in question was a graphic- or processor-intensive, such as a game.

Proper termination of all applications should help on both the responsiveness and battery life fronts.

What I can say for certain is that with my very first sync + backup cycle on the new firmware, things are noticeably improved. Whereas before, syncing my iPhone to add a few new songs or one new photo could take many minutes, it now whips through the whole cycle in only seconds.


One brand-new feature the 2.1 firmware introduces is “Genius playlist creation”. Genius will create an ad-hoc playlist based on the current song you have selected. Genius playlists created in iTunes will automatically sync with your iPhone, but you can also create on-the-fly Genius playlists right on the iPhone itself. When a song is playing, touch the screen to bring up the controls, and click the new “Genius” icon in the middle, just under the progress indicator.

Further testing and real-world use will confirm or disprove these initial good feelings, but for now, things are looking rosy.

  1. Yes, there are some notable exceptions for certain Apple applications. 


Neal Stephenson’s latest effort, Anathem, is to be published on September 9, 2008. I’ve been a big fan of Stephenson ever since I first read Snow Crash many years ago1.

Whenever I read through Snow Crash, i’m always amazed at– besides the unique characters– the forward-thinking ideas he espoused way back in 1992. Many of his cyberpunk notions don’t seem so far-fetched, or even far at all.

I’ve also read Cryptonomicon several times as well, despite it’s War & Peace-esque stature. Stephenson takes innumerable rabbit trails in his stories, oft-times as a seemingly inside-joke-for-geeks. But that’s part of what makes it fun.

(I will shamefully admit that I still haven’t yet waded through all three books in The Baroque Cycle. I always seem to get bogged down about 2/3 of the way though each book. If I ever break something and have to be in traction for several weeks.)

Anathem book review to follow.

  1. And continue to do so at least annually 

After →