Skip to main content

venutip's blog

The Curious Case of .*

About a month ago, I Tweeted what I thought was some pithy advice on the use of .* in regular expressions:

#regex tip of the day: never, _ever_ use .* unless you are forced to do so in a #24-style 
kidnap situation. And even then, think twice.

Funny and topical! But as it turns out, I spoke too soon. Early in Chapter 5 of the superlative Mastering Regular Expressions, the author (Jeffrey Friedl) demonstrates how the judicious use of .* can actually help you to write some very efficient regular expressions.

Views and i18n

I just started working on my first multi-lingual site in Drupal this week (woo-hoo!), and ran into a minor issue with one of my views: both the English and Spanish versions of translated nodes were appearing in the view. No good!

A Flat-footed Runner Tries Vibram FiveFingers

The first thing I noticed about running in the Vibrams (this is while I was still in the store) was that I seemed to be coming down more on the balls of my feet, instead of on my heels. I’d read that this was likely to happen, but was surprised to see the change take effect so quickly.

The Right Way to Override Theme Functions

I started building my first WordPress site last week and almost immediately starting customizing the theme. Rather than editing the default theme directly, however, I created a child theme, basing it off one of the many theme frameworks available for WordPress. Creating the child theme was painless, and there is plenty of information on how to do so.

Loops : recursion :: tables : CSS

The latter may seem harder to understand at first, but in certain situations, the former is a nightmare, whereas the latter is a pleasant dream.

Increase the phpMyAdmin Session Timeout

File under

phpMyAdmin is one of my favorite tools and I use it all the time. But man, the 30-minute session timeout is a huge PITA. A short cookie lifetime is all well and good on your production server, but what about when you’re just hacking away on the computer in your bedroom?

Flickr Slideshow Support in Drupal Content Fields

File under

Just released a patch to the Video Filter module that adds support for embedding Flickr slideshows in content fields. It’s pretty flexible. Just browse to a set or its slieshow, copy the URL, and add it as you would any other media type in Video Filter:

[video:http://www.flickr.com/photos/some_user_name/sets/56109963647105794/]

So far it’s just for the 5.x branch, but if the patch is accepted and there’s interest, I’ll gladly port it to 6.x.

Installing IE 6 and IE 7 on Ubuntu

If you develop or design web sites, there is simply no getting around the suckfest that is IE. On Windows, it’s difficult enough to run concurrent copies of the turd. But what are you supposed to do on Linux?

Installing the Vista Fonts on Ubuntu

File under

Having recently read In the Beginning was the Command Line, Neal Stephenson’s peerless deconstruction of operating systems (slightly more nuanced than the current “I’m a PC! I’m a Mac!” “debate”), I decided it was time to do what I’ve threatened to do for years: switch to Linux.

Getting a path to your subtheme

File under

Was working with a subtheme today and ran into a problem with theme_get_path(), which is supposed to return the path to the active theme (actually, it's slightly more complicated than that; the value you get back depends on the context in which you call it).

Unfortunately, theme_get_path() does not always work correctly for subthemes.

Syndicate content