All Topics:
apps
css
dashboard
games
javascript
php
tehcl
textmate
tools
video

1234567890 Day Countdown

updated:
2009.02.13
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.


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.


Updated: jQuery Animating Same-Page #Links Bugs

updated:
2009.01.24
published:
2009.01.18
topics:
javascript

Hey, read this first: There has been I'm sure many further enhancements since my patches. I'd check up on the smooth scroll github project hosted by Karl Swedberg. He is the original author of the code that I patched and has been maintaining everything.

Update: I have developed a potential fix for the Opera bug Karl Swedberg discussed in his comment on this post. Update #2: I've made further changes after Karl's second comment.

When designing this site I decided I wanted to animate smoothly scrolling to same-page #links, such as my link to the moon. I decided to use the "improved" version of the animated scrolling code originally written by Karl Swedberg. I've since found two fixed three bugs with this code. Read the rest of this post for the details and fixes.


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.