Happy New Year!

Soon it will be time to begin working on dinner for tonight, so while there is still time: Happy New Year to everyone! All the best for 2009, may it be a good year for you.

WordPress 2.7

I just finished the ugprade to WordPress 2.7. I was more careful than usual given the big update (normally I just overwrite the files, this time I actually followed the instructions), but everything apparently went fine. I really like the new admin screen, it’s much cleaner and clearer. Please let me know if you find anything broken.

Spam-vs-ham pie chartThe Akismet stats screen is really nice too. Check out this impressive pie chart of spam-vs-ham on my blog. And I don’t get that many comments. Incredible.

Faster version of "Clean downloads stack"

For some time I have been using this technique (with the variation mentioned in my comment: use the application also as the stack overlay icon) to clean my Downloads stack in the OSX dock. The only problem with using an Automator app is that it is quite slow, so I have replaced it with a shell script that does the same thing: remove every file in the Downloads directory except itself. I have made an OSX application from the script using the fantastic Platypus, and you can download it here. To use it:

  1. Unpack the zip file and put the ” Clean Downloads stack” application in your Downloads folder.
  2. Run the following command:
    touch -mt 202001010101.01 " Clean downloads stack.app"

If you want to roll your own, here’s the script (which you can find inside the app as Contents/Resources/script:

#!/bin/bash
DIR="$HOME/Downloads"
cd $DIR
ls -1 | grep -v 'Clean downloads stack' | sed 's/^/rm -rf "/; s/$/"/' | bash

This does the same as the Automator workflow from the original hint, but much, much faster. Of course, you may want to change its icon to match your selected overlay icons.

Enjoy!

WILTAC #5: zero is a special case

Zero is a special case for NSNumberFormatter

I spent a few minutes today trying to figure out why, when setting a value to zero in an NSTableView, the number formatter I had associated with that column (to add a percentage sign to each number) was not being applied. Eventually, I realized that zero is a special case for NSNumberFormatter, and by default the percentage sign was not there. Adding it solved the mystery.

Grabcartoons 2.4

A new release of my comic-grabbing script Grabcartoons is out! It includes many updates and fixes, a new ability to define site-wide “templates” to easily fetch any comic from a hosting site (templates are included for comics.com and gocomics.com), a new option to choose and fetch a random set of comics, and more.

As usual, tip of the hat to Ben Kuperman for encouragement, testing, coding and ideas.

Enjoy!

Using automator to download desktop pictures (howto)

I get most of my desktop background pictures from either vladstudio or the NASA Image of the Day site, both excellent sources of fantastic images. To make it easier to fetch a particular image, I have created two Automator workflows, which you can download here:

Get image from Vladstudio.zip

Get image from NASA image of the day.zip

To use them, unzip and place the .workflow files in your ~/Library/Scripts/Applications/Safari folder – by putting it there they will appear at the top of the script menu when Safari is the active application (if you don’t have it enabled, you can do so by running AppleScript Utility, found in /Applications/AppleScript).

Before you use them, you should configure them to your settings. Open the scripts in Automator and change the following:

  • The resolution of the image you want. In both scripts it is found in several of the steps (either as “1600×1200” or “1600-1200”, make sure you change all of them and use the same format as before). The NASA site supports 1600×1200, 1024×768 and 800×600, Vladstudio in addition has 800×480, 1024×600, 1152×864 and 1280×1024.
  • The folder where you want to download the images. Double click the “DesktopImagesFolder” in the list of variables at the bottom of the Automator window, and select the folder where you want to put the images.
  • If you don’t have Growl or don’t want notifications, simply click the “X” button on all the steps in each workflow that mention Growl or growlnotify.

Once you customize and save the scripts, you should be able to select the corresponding script when viewing an image on either site, and the appropriately-sized image will be automatically downloaded and saved. Make sure you don’t navigate to a different page or tab in Safari until the script has run.

Enjoy!

Booting from an external DVD drive using Firewire Target Disk Mode

This is documented by Apple but I had never realized it: if you put a Mac in Firewire Target Disk Mode, its DVD drive is also available, and it can be used to boot, for example, a machine that does not have a DVD drive (hold down Option while turning the machine on to access the Startup manager). Very useful! Somehow I had always assumed only the machine’s hard drive was visible in TDM.