Topics:
apps
css
games
javascript
mobile
node
php
speaking
tehcl
textmate
tools
video
webgl

1234567890 Day Countdown

published:
2009.02.13

Unix time 1234567890 is quickly approaching today has passed. Don't know what the heck that means? Want to know exactly how much longer before it happens? Check out 1234567890day.com. I decided to quickly whip together a couple ways for geeks to count up to the event on the command line.


Be Careful Using PHP's empty()

published:
2009.02.09
topics:
php

Glen Stansberry recently shared his great tutorial about 10 PHP Mistakes, but I thought there was one other mistake so important and easy to make that it was worth explaining: PHP programmers of all skill levels can easily use the empty() language construct incorrectly.


Tracking Browser Window Size with Google Analytics

published:
2009.02.02
topics:
javascript
tools

When it comes to picking a width for my web designs, what I really want to know are the common browser window dimensions for a visitor. Google Analytics tracks screen resolution, but this is increasingly meaningless with the rising popularity of super high resolution wide screen monitors. Most websites these days are 1024 pixels wide or less, thus my browser window is generally about 1000 pixels wide. Every so often I visit a website that is setup for a 1280 pixel wide screen, and even though my widescreen monitor is much higher resolution than this, it really annoys me to resize my browser window. I don't want to hassle my visitors by being the only website they visit that forces them to resize. I will show you how to track the browser window dimensions (actually, the inner window viewport dimensions) for your visitors in Google Analytics. Update: Thanks to Paul for giving me a kick in the rear to fix a bug with listening to resize events.


My Error 404: Making a Black Hole with the Canvas

published:
2009.01.27
topics:
javascript

I felt like I should do something fun with the zachstronaut Error 404 page. Doing something witty with your error pages (specifically 404) is a fine, long running tradition on the internets. I was reading Wikipedia pages about celestial objects and sifting through the NASA site for inspiration when I got bored and decided to play some Super Mario Bros. It was after beating World 1-4 that I had that "eureka!" moment.


Relative Date / Time Strings in PHP

published:
2009.01.20
topics:
php

I've noticed that Facebook, Twitter, and lots of other sites are using a relative date and time string description for user posts and comments. For example, "comment written about 3 months ago" instead of "comment written on October 20, 2008." I decided to do the same thing on this site, although rather than saying "3 months ago" I made it say "T plus 3 months." I adopted the NASA language for keeping track of post-launch time. If you've ever heard a NASA employee (or an actor portraying a NASA employee) say, "T minus 1 minute to lift off," that is their standard language for pre-launch time. Same idea. (Perhaps I'm taking this space thing a little too far... whatever. All in good fun.)

I want to share the PHP function I wrote to convert the timestamp of a comment or Tweet — or anything else — into a relative time string. Code after the bump.