wonko.com

Hi! I'm Ryan Grove: Sorcerer at SmugMug, lover of movies, eater of pie, connoisseur of awesome.

Older posts

Displaying items 111 - 120 of 662

Ramaze is beautiful

Avdi Grimm discusses the subject of beautiful code in his latest blog post, and he uses the Ramaze source code as an example. He’s right; Ramaze is an excellent example of clean, well-organized source code, which is one of the reasons it’s become my web framework of choice.

One side effect of having such a clean codebase is that it lowers the barrier of entry that might otherwise prevent people from contributing patches. As a result, despite the fact that Ramaze is young and still fairly unknown as open source projects go, it has many active contributors and is maturing rapidly.

Bee mystery

This morning when I left for work, I noticed approximately ten honeybees sitting, motionless, on the inside of the closed garage door. It was the first time I had seen bees in the garage and I was worried they might be swarming in the roof or something since it didn’t seem likely that all of them had gotten in by accident, but there was no swarm that I could see; just ten motionless bees. I left them there and went to work.

When I came home this evening, the bees were no longer on the garage door. I thought they must have flown away until I noticed a dead bee on the ground. Looking closer, I found another, and another, and another. In all, I counted twenty-five dead bees on the ground, and one that was still alive and standing but barely moving.

There are two mysteries here:

  1. Where did the twenty-six bees come from?
  2. What killed twenty-five of them and left one virtually paralyzed?

Anyone?

The Worst Journey in the World

The Worst Journey in the World (book cover) I recently devoured The Worst Journey in the World by Apsley Cherry-Garrard, a riveting account of the Terra Nova Expedition, which culminated in Robert Scott’s fatal journey to the south pole and (almost) back.

The polar journey itself didn’t actually occur until two years into the expedition and, while spectacular in its own right, is not really the focus of the book. The titular journey, in which the author and two others set out during the Antarctic winter of 1911 to retrieve eggs from what was then the only known accessible Emperor Penguin rookery, is an epic tale of suffering and perseverance, but it’s not the book’s focus either.

Interweaving his own recollections with the letters and journal entries of himself and his companions, Cherry-Garrard tells a story not about a single expedition to Antarctica, but about mankind’s inherent need to explore the unknown fringes of the world we inhabit and to expand our knowledge of it at any cost.

I strongly recommend this book.

Thoth 0.1.3 released

Thoth 0.1.3 has been released. This version contains the following changes:

  • When creating or editing a blog post or page, the preview is displayed above the edit form rather than below it.
  • Spaces in blog post URLs are replaced with – rather than _ (this change will only affect new posts; existing post URLs will not be changed).
  • Blog posts provide Atom feeds for recent comments.
  • Tag pages provide Atom feeds for posts with that tag.
  • Blog posts are marked up using the hAtom microformat.
  • Thoth auto-generates an XML sitemap at http://yourblog.com/sitemap (set site.enable_sitemap to false to disable).
  • Comment URLs are built using the name of the post the comment is attached to rather than the id.
  • Fixed a bug that prevented Atom and RSS feeds from being cached when server-side caching was enabled.
  • Fixed entry titles in Atom feeds claiming to be type="html" when in fact they weren’t.
  • Fixed a bug that sometimes caused flash messages to be cached with the output of an action and re-displayed until the cached action expired.

To install Thoth for the first time, run:

sudo gem install thoth

Or, to upgrade an existing Thoth blog:

sudo gem update thoth
cd /path/to/blog
thoth -d restart

blink tag compatibility script

Update: Yeah, April Fools. For the sake of my own sanity, I’ve removed the actual blink tags from the post now that the fun has worn off. Please don’t actually use this code or I’ll hunt you down and throw angry kittens at your face.

While working on a new feature for Yahoo! Search today, I ran across an interesting problem. It seems that some A-grade browsers have a serious bug: they don’t support the HTML <blink> tag, which has been part of a w3c spec since 1999.

Since I absolutely wouldn’t have been able to implement this awesome new feature without the <blink> tag, I went ahead and wrote a JavaScript compatibility shim to add support for it to buggy browsers:

/**
 * blinktag.js v1.0.0 (2008-04-01)
 *
 * Compatibility shim to implement the <blink> element in browsers that don't
 * properly support the w3c spec (for spec details, see
 * http://www.w3.org/Style/HTML40-plus-blink.dtd).
 *
 * For a demo and usage examples, see
 * http://wonko.com/post/blink_tag_compatibility_script
 *
 * Copyright (c) 2008 by Ryan Grove <ryan@wonko.com>.
 * All rights reserved.
 */

setInterval(function () {
    var i, s, tags = document.getElementsByTagName('blink');

    for (i = 0; i < tags.length; ++i) {
        s = tags[i].style;
        s.visibility = s.visibility == 'hidden' ? 'visible' : 'hidden';
    }
}, 1000);

Feel free to use this script in your own projects until Microsoft and Apple fix this bug.

CrashPlan status report: still awesome

Early last year I wrote a positive review of the online backup tool Mozy. Like a fool, I neglected to test its restore functionality, and a few months later when I suffered a hard drive crash and tried to restore 20+ gigs of data from my Mozy backup, I learned that Mozy can’t restore for shit.

After extensive testing of both backup and restore functionality, I decided to switch to CrashPlan for my online backups. Back in September, after having used it for several months, I gave CrashPlan a glowing review.

So, seven months later, would I still recommend CrashPlan? Yes. Hell yes.

CrashPlan has backed up my data quietly, reliably, and without fail. It hasn’t ever crashed or frozen and it doesn’t hog my system resources. Most of the time I don’t even remember it’s there. But most importantly, CrashPlan has saved my ass several times, and each time it’s worked so well that it almost makes me want to do stupid shit more often just so I can experience the pleasure of having my ass saved again. It works that well.

When I migrated from a PC to a Mac last year, I copied all my important data off the PC’s hard drive, then wiped it clean. At least, I thought I had copied all my important data. Naturally, as soon as I finished nuking the drive, I realized I had only copied one of my two partitions. A few clicks later, CrashPlan was happily restoring the lost files to my new Mac from the PC’s most recent backup. I didn’t lose a thing.

That’s been the story every time I’ve needed to restore something. Whether it’s a single file of just a few kilobytes or a whole directory containing several gigabytes, CrashPlan begins restoring the files instantly and only seems to be limited by the download speed of my Internet connection. Mozy’s painful, slow, unreliable restore process is nothing but a distant nightmare now.

CrashPlan and Mozy both make lots of big promises about how safe and secure your data will be and how easy it’ll be to restore in the event of a disaster; the difference is that CrashPlan actually keeps its word.

Thoth 0.1.2 released

Thoth 0.1.2 has been released. The only changes are Ramaze 0.3.9.1 compatibility and a new MinifyController that minifies Thoth’s CSS and JavaScript on the fly.

The minification is handled by two new Ruby libraries: CSSMin, which is a port of the YUI Compressor’s CSS minification routines to Ruby; and JSMin, a Ruby port of Douglas Crockford’s JSMin.

Feel free to use these libraries in your own projects. They’re available as individual gems for your convenience (named “cssmin” and “jsmin”, naturally).