Set up JAVA_HOME to track Java Preferences.app on Mac OS X

/Applications/Utilities/Java Preferences.appMac OS X’s Java Preferences.app has a pane for switching between versions of the JDK, but I just found out from a coworker (thanks, Mike!) that you can make your shell match that preference easily — just add this to your ~.bashrc:

export JAVA_HOME=$(/usr/libexec/java_home)

If you change your JDK priority preference, you’ll need to re-source your ~/.bashrc or just open a new terminal window.

Tricks with Safari on the iPhone

If you click the time bar at the top of the screen, safari will quickly scroll to the top of the frame where the location field is, set the focus to the location field, and expose the search field as well.

Double-tapping in safari alternatively zooms into a block of text or zooms back to fit-width-to-page. Two-finger pinch-zoom works too, which can help in filling out forms (like google’s search box).

iPhone’s iPod Time Scrubber


In iTunes, while holding the iPhone in portrait mode, tap the middle of the album art. A time-scrubber widget will show up right below the song title, allowing you to jump to a certain point in the current song.
This is really handy for audiobooks and podcasts, but the longer the song/podcast, the less precise the 1-inch scrubber is.

I wonder why they gave up on the scrollwheel?

Update August 2009:

Apple addressed the problem with precision in the scrubber in the iPhone 3.0 system update.

Once you see the scrubber, touch and hold your finger on the scrubber, and move your finger down the screen — the farther away from the scrubber you hold your finger, the slower you will fast-forward or rewind. They also gave a “rewind 30 seconds” button that is niftiness, too. Well done!