Rob Larsen

Archive for the 'Code I Like' Category

Code I Like: Batch Subversion Rename (Replace Underscore with Hyphen), Bash Script

That's an unwieldy title, if I ever saw (wrote?) one. Still it describes the code in question exactly, so unwieldy will have to do for this post.

Anyway, for SEO purposes I've wanted to rename some of my files from underscore delineated (_) to hyphen delineated (-) for a couple of years now. I chose wrong when I originally launched this site, and since it's huge (something like 400 static pages), I never wanted to actually go through with the renaming. And that was before I got the site into Subversion. With Subversion in place I couldn't even use one of the many little file renaming apps out there. I'd have to do the work within SVN or else things would be bad. Very bad.

A disheartening problem.
(more…)

Code I Like – Link Prefetching

I was reading John Resig's Browser Page Load Performance post earlier today and followed up from there on the concept of Link prefetching. Currently supported by Firefox 2+, Link prefetching is a browser based mechanism for fetching "future" content. Considering I wrote (and ultimately scrapped*) similar functionality for my gallery pages, I was obviously intrigued.
(more…)

Code I Like: Using Apache's .htaccess and mod_rewrite to Redirect All Traffic to "www"

I know I was talking about HTML/CSS and JavaScript when I started this series, but I never said anything about being exclusive to the presentation layer :)

And heck, there's always room for Apache when I'm talking about technology…
(more…)

Code I Like: A JavaScript Object as an Argument for a Function

This will hopefully be the first of a continuing series of smaller code articles where I share techniques I (and my team) use on a daily basis. I take this stuff for granted so I think it might be beneficial to share since (a) I might be able to improve what I do by receiving feedback on techniques I use and (b) some of the things I do, while old hat to me, might be new and useful to other people in the field.

We'll see how it goes.
(more…)