CSS Naked Day

With CSS Naked Day fast approach­ing, I thought I’d add to the code snip­pets pos­ted by Dustin Diaz with a quick bit of Perl, based on his PHP example. Without fur­ther 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 sub­routine could then be used to dis­play tem­plate con­tent like so:
unless ( (&_is_naked_day(9)) ) print qq^<link rel="stylesheet" type="text/css" href="/path/to/styles.css" />^;
Caveats: I haven’t accoun­ted for time zone dif­fer­ences, the concept of an inter­na­tional day (tak­ing a 12 hour slice on either side of GMT) and the JSON con­fig file that Dustin provided in 2008 (which I just found). I’ll write a Perl mod­ule to handle this all in a more usable fash­ion and post it up after work later today.

Read More

Untitled

Ran­dall Stross has a dis­turb­ing ana­lysis of the text mes­saging pri­cing struc­ture over at the NYT[1]. [1] http://ping.fm/wkUUs While this is a ana­lysis of the US telco SMS stack, it’s pretty applic­able to the Aus­tralian gang of four as well. An inter­est­ing (and some­what dis­turb­ing) read.

Read More

Untitled

It’s Monday morn­ing, and I am still recov­er­ing from the Ele­fant Trax 10 year anniversary party. Massive night, awe­some tunes and a wicked vibe throught the area. One of the best Aus­tralian hip hop nights that I’ve ever been to, so big up to the ET crew. Look­ing for­ward to the next one next decade!

Read More

Untitled

Glory, glory hal­le­lu­jah. You can now design your own Mup­pet in the US via FAO Schwartz. http://ping.fm/rROcF The pricetag ($USD90) is pretty reas­on­able too.

Read More

Untitled

Appar­ently one of my employer’s coloca­tion data cen­ters has nearly all of its employ­ees off today — who would have thought the US elec­tion would be so pop­u­lar in Australia?

Read More

Untitled

Thanks to Adam’s cus­tom ker­nel grabbed from http://ping.fm/gllx0 I’m now run­ning Xubuntu on my Eee PC. Boom Xfce4! Actu­ally 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 ran­dom inter­net­ting modes (a bit) separate.

Read More

Untitled


Warning: Illegal string offset 'tagName' in /home/sashagerrandidau_prd/sasha.gerrand.id.au/blog/wp-content/plugins/wp-typography/php-typography/php-typography.php on line 1990
“The great thing about mod_rewrite is it gives you all the con­fig­ur­ab­il­ity and flex­ib­il­ity of Send­mail. The down­side to mod_rewrite is that it gives you all the con­fig­ur­ab­il­ity and flex­ib­il­ity of Send­mail.” — Brian Behlendorf’s quote still rings true, even after 8+ years with heavy use of mod_rewrite.

Read More