I am building a prototype VM where performance is largely irrelevant. Yet still I repeatedly found myself optimizing: caching, interning, fast-pathing, etc. I just can’t stop myself. There is something particularly insiduous about performance. I think it is that it is so much easier to think about performance than subjective design issues. Performance is objective — you can actually quantify it, unlike most of the issues that really matter: subjective design issues with no clear cut answer, which can be almost impossible to evaluate while you are still developing. As engineers we crave the objective and quantifiable world of performance. So we focus on that even when it isn’t important. Most of the time it isn’t important.
View Source in TextMate for Safari
Have you ever had the need to check the source of the current page in Safari, only to discover this ugly little window that doesn’t do any kind of syntax highlighting?

Wouldn’t be neat to open it in TextMate instead? And wouldn’t be even more neat to have it as an item in a Safari menu? Yes? Ok, so let’s create a custom service!1
First start Automator, select the “Service” template and add the “Run Applescript” action. Then copy and paste the following script in the action’s text area.
This script will automatically fetch the URL and title from the frontmost page in Safari, save the page as a temporary file, and open it in TextMate.
Since the script uses Safari’s AppleScript interface to fetch the necessary information, it doesn’t need any prior info from the browser. So let’s tell Automator that:

Save and you’re done. Enjoy it.
Note that with this technique you can create all the custom Services you need, and even assign them keyboard shortcuts.
To do that, head for the Keyboard panel in System Preferences and let the following picture speak for me.

-
if you don’t want to do this work, I have done it for you. Download the service, extract it in
~/Library/Servicesand restart Safari. ↩