CSS Naked Day

With CSS Naked Day fast approaching, I thought I’d add to the code snippets posted by Dustin Diaz with a quick bit of Perl, based on his PHP example. Without further ado, here is the snippet: 
use Time:Local;

sub _is_naked_day() {
    my ($start, $end, $now, $d);
    $d = shift;
    $start = timelocal(0, 0, 0, $d, 3, ((localtime)[5]));
    $end = timelocal(59, 59, 23, $d, 3, ((localtime)[5]));
    $now = time();
    if ( $now >= $start && $now  = $end ) return(1);
    else return(0);
}
This subroutine could then be used to display template content like so: 
unless ( (&_is_naked_day(9)) ) print qq^<link rel="stylesheet" type="text/css" href="/path/to/styles.css" />^;
Caveats: I haven’t accounted for time zone differences, the concept of an international day (taking a 12 hour slice on either side of GMT) and the JSON config file that Dustin provided in 2008 (which I just found). I’ll write a Perl module to handle this all in a more usable fashion and post it up after work later today.

Untitled

Randall Stross has a disturbing analysis of the text messaging pricing structure over at the NYT[1]. [1] http://ping.fm/wkUUs While this is a analysis of the US telco SMS stack, it’s pretty applicable to the Australian gang of four as well. An interesting (and somewhat disturbing) read.

Untitled

It’s Monday morning, and I am still recovering from the Elefant Trax 10 year anniversary party. Massive night, awesome tunes and a wicked vibe throught the area. One of the best Australian hip hop nights that I’ve ever been to, so big up to the ET crew. Looking forward to the next one next decade!

Untitled

Thanks to Adam’s custom kernel grabbed from http://ping.fm/gllx0 I’m now running Xubuntu on my Eee PC. Boom Xfce4! Actually glad that I went for the non solid state HDD model too. I’ve kept the machine in a dual OS boot (Windows/Linux) for the moment, mainly to keep the work and random internetting modes (a bit) separate.

Untitled

“The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail.” — Brian Behlendorf’s quote still rings true, even after 8+ years with heavy use of mod_rewrite.