Hiding Image Files in TextMate

Here’s how to hide JPG, PNG, and GIF files in your TextMate projects so bulk file operations go faster.

TextMateTextMate, perhaps the best generic programming editor that I’ve ever encountered (though I’d be willing to entertain reader suggestions), has the ability to open an entire directory at once, which is great for making bulk changes to automatically generated website files.

However, there’s one trick that I keep having to look up each time I do it, and that’s how to get that side-bar directory listing of the project files not to display image files. The reason you might want to do this is for efficient global replace options across all text-based site files.

The solution is to click the top-level directory in the project, and press the I button in the bottom right corner of the drawer.

This opens a Folder Information dialog box. In the area labeled Recursively Include Contents Matching there are two fields, one for files and one for folders. In the File Pattern field, enter this regular expression: !\.(jpg|png|gif)$

When you close the Folder Information dialog box, all files with the extensions listed will no longer be displayed.

Leaf the Red Ones

After returning home today, I hopped out of the car and saw our next door neighbor’s little girl raking leaves. Although the small child-sized rake still towered over her by a good foot, she was doing her best at the apron of the tree. Nearby was a small colorful pile.

“Make sure you only do the red ones.” I pointed at our tree, which was a solid bright orange. It was also the the only color of leaves scattered over our unraked lawn.

She looked up at her red sugar maple, which was littered in bright red and orange leaves, down at her pile, and pushed the rake away, “Why didn’t someone tell me that? I’ve been working all day!”

I quickly went inside. Mission accomplished.

Garmin WebUpdater

I own a Garmin GPSmap 60CSx in order to geoencode my photography using HoudahGeo.

Garmin now has a means up updating the firmware in their GPSs by using a WebUpdater, of which I use the version for the Mac.

I Got Myself Into Trouble
In retrospect, I got myself into trouble by starting the program, it failed to detect the GPS, to which I turn on the GPS, and plugged it into the USB port. While the WebUpdater saw the device and went to update, it stayed in the “Erasing… Do Not Unplug” state for about two hours before I got brave.

What I Did, And Boy Was I Lucky
I couldn’t cancel. I couldn’t Quit. So I had to Force Quite by using Command-Option-Escape, that at least got WebUpdater to stop. The GPS was still stating “Loader Loading…” when I pulled the USB, and when that didn’t change anything, I turned off the power to it. I wasn’t so sure I was going to see much of anything when I powered it back on.

I got lucky. I turn the power back on and I was still at the old revision. Then plugged in the USB to the computer. Then started WebUpdater, which again noticed the GPS version, downloaded the firmware again, and had no problems installing it. Seems doing things in this order works just fine.

My Plans If I Was Unlucky
Over on Bill Turner’s site, he’s written an article about Fixing a Dead Garmin GPSMap 60CSx. It seems he’s learned holding down the Power Button and the Up Arrow at the same time while starting the WebUpdater software (I think he has three hands to pull this off), he’s able to force the GPS to identify itself to the updater. Problem is, according to his instructions, you have to keep holding down these button chord during the update; some comments on the blog state it isn’t necessary, and there’ve been mixed results as to whether this works universally or not.

I’m not sure I would have had the bravery to just go killing processes plain outright, but since Bill did such a nice job of providing an alternative, I felt it was worth the risk — even if I didn’t have to go that route. Thanks Bill for blogging your GPS recovery notes.

Clever Bulk Rename Trick in Windows

Stumbled into a clever way to rename a bunch of files to have the same prefix and a sequential numbered suffix… from the Windows GUI no less.

Ever want to rename a bunch of files to the same prefix, but have an incremental count after them?

From Explorer, select all the files that you want to bulk rename, right click, and select Rename.

While all of the files will be selected, only one is editable. Give the file a name, let’s pretend for the sake of discussion you typed ABC.jpg.

All of the rest of the files will be renamed ABC (1).jpg through ABC (n).jpg, where ‘n’ is the number of files minus one, since the first one doesn’t get a number.

Knowing this, you can do some clever stuff. Create one bogus file renamed to ZZZZZZZZ.TXT at the end of your list; select all the files, and bulk rename them as shown above. Then delete the bogus file, it should be the only one without a number, and you’ve just made a sequence of files.