matterkkila.com/

code monkey

./unfuck.sh

May 27, 2008 - 8:32 PM

Any coder will tell you that sometimes things just don't work right. The output isn't what you expected, the data isn't getting into the DB for some unknown reason, the cache isn't getting updated. There are a number of things that can occur when you work on a large code base.

Anytime something like this happens here at Digg we often joke about wanting a ./unfuck.sh script that will magically fix things. This would have to be some magical piece of software with all sorts of machine learning and AI in order to find and fix the problems we have on any given day.

Well the other day I gave a stab at writing one. Turns out it only needed a few lines of code to get working.


if ( committer.name == 'Joe Stump' ) { rollback(); }
if ( committer.country == 'canadia' &&
committer.species == 'dirtyfilthyhipster' ) { redoalljs(); }

For those who might not know. Joe Stump is the architect here at Digg and regardless of how often we joke about his code, he is pretty good at what he does. The person from Canadia, or Canada as some like to say, and happens to be a hipster, who we joke about being dirty and filthy as most hipsters are, is Micah Snyder. He is Digg's JS wizard. He even has a wizard hat that he wears when he is coding. One of these days I will remember to take a picture of it.

Posted In: