Friday, October 28, 2011

Upgrade from password gem to 1password

In 2008 I wrote a password gem, but today I use 1password, so I wrote a simple 1password importer shell script.

Monday, October 24, 2011

Silicon Valley Human Rights Conference

Unfortunately I only just found out about this, but I'm really pleased to hear it exists.

Environmentalists Knit Sweaters For Penguins

After a catastrophic New Zealand oil spill started killing a terrible number of blue penguins, activists responded with ludicrous style and aplomb.

Saturday, October 22, 2011

Two Notes About Game Of Thrones

I've been reading the Song Of Ice And Fire series. It's so grim, brutal, and full of sex (occasionally for erotic effect, but usually for shock and horror) that it reminds me of Caligula, but unlike Caligula I'm enjoying the story. Two brief notes about the series:

First, I'd bet a lot of money its author, George RR Martin, read the Assassin series by Robin Hobb. Both feature a scheming queen unworthy of her king, whose violent, psychopathic, sadistic child becomes the next king, despite having no valid claim to the kingship. Both feature zombies and Vikings, and the ruins of a much greater ancient empire. Hobb's series takes place in a land called the Five Duchies; Martin's setting is called the Seven Kingdoms. Each series features protagonists who share a psychic bond with a wolf, and dragons who, in times past, fought in service to the king, but have since disappeared from the world. Both series give attention to the role of bastards in the medieval-like societies of their settings. Both series have castles filled with secret passageways, unsavory characters who lurk in those passages doing terrible things for the good of their respective kingdoms -- or for their own advantage -- and marriages of political expediency.

In short, I think Martin read Hobb's series and decided to do his own version.

This is not such a bad thing. I sometimes think the same thing about the relationship between Inception and The Matrix -- that maybe Christopher Nolan saw The Matrix and decided to make his own artistic answer to it. In fact I like to think of Inception as the sequel that The Matrix always deserved but never got.

One reason I think this whole phenomenon of an artistic answer to a previous work is totally cool is because Martin's remake expands on the scope of Hobb's original to a degree which is so extraordinarily detailed, and realized in such depth and detail, that it makes JRR Tolkien look like a lazy stoner who never did his homework. Which brings me to the second note. If somebody came to me and said, "I need to learn Rails, what should I do?", I would tell them that they could do worse than to build an application which allowed the user to document the world of A Song Of Ice And Fire.

The series keeps track of a staggering number of noble families, each with very detailed family trees. Each family has its own heraldry, castles, counties, warriors both noble and common, and feuds both recent and ancient. Every member of those families has their own distinct characteristics, including sexual history, style of clothing, favorite food, names, nicknames, and distinct reputations at local, regional, and in some cases even global levels. Regions have gods, customs, dialects, and even hairstyles, for fuck's sake. It came to me that developing a plain vanilla Rails app to track all that shit would be a great exercise in object-oriented design when I asked myself what George RR Martin's writing space must look like. I hope it features outlines, graphs, timelines, maps, and family trees all over every wall, but the thought that terrifies me is that maybe, just maybe, he keeps the whole damn thing in his head.

Friday, October 21, 2011

Code And Beats: NYC Party

Enigmatic web site says only:

A handful of hardcore coders from the city's hottest startups will work in the center of a pounding dance floor to a musical journey of electro beats.

Jasmine-Node: Identify Failing Spec

I love jasmine-node for command-line JavaScript specs, but there's one thing I hate about it: its failure messages. The usual error output is complete line noise. No indication what spec failed, no indication of even which file the spec which failed lives in. Here's how you find that out.

I'm going to set this up as a command-line option and send a pull request later, assuming I remember, but for now, open up node_modules/jasmine-node/lib/jasmine-node/index.js. Add one line right here:

Edit: yeah, ok, fuck. Actually that didn't work. You can at least run it file-by-file, using bash and the -m command-line flag, but the regex in -m is pretty freaking primitive and literal. For instance, to run individually, I just did:

node_modules/jasmine-node/bin/jasmine-node -m foo_ --coffee spec/javascripts/node/

That underscore in foo_ is not a typo!

If you don't see a followup blog post where I explain how I fixed this, please bug me about it on Twitter. It's a good project and these are easy fixes. By the way, the reason I have spec/javascripts/node is because I also have spec/javascripts/browser. Although I like jsdom, for Backbone views, I'm running regular Jasmine in the browser, because browsers are notoriously twitchy.

Side Projects: The Lamborghini Miura

This is (or maybe was) DHH's Lamborghini (photo by symmetricalism).

Most Rails developers know DHH extracted Rails from an application he was building. It may even have been a side project. What many people do not know is the core design of DHH's Lamborghini started as a side project too, about 40 years ago.

From the September issue of Robb Report:

The Miura, the first viable mid-engine sports car, might be Lamborghini's most celebrated model, for both its mechanical and aesthetic attributes, but company founder Ferruccio Lamborghini did not initially champion the automobile. Knowing that their boss planned for the then newly-formed marque to produce refined grand tourers instead of race-ready sports cars, the engineers initially developed what would become the Miura in their spare time.

Wikipedia has more:

The car is widely considered to have begun the trend of high performance, two-seater, mid-engined sports cars. At launch, it was the fastest production road car available.

The Miura was originally conceived by Lamborghini's engineering team, who designed the car in their spare time against the wishes of company founder Ferruccio Lamborghini, who showed a preference towards producing powerful yet sedate grand touring cars, rather than the racecar-derived machines produced by local rival Ferrari. When its rolling chassis was presented at the 1965 Turin auto show, and the prototype P400 debuted at the 1966 Geneva show, the car received a stellar reception from showgoers and motoring press alike, who were impressed by Marcelo Gandini's sleek styling as well as the car's revolutionary design.


During 1965, Lamborghini's three top engineers, Gian Paolo Dallara, Paolo Stanzani, and Bob Wallace put their own time into the development of a prototype car known as the P400. The engineers envisioned a road car with racing pedigree; a car which could win on the track and be driven on the road by enthusiasts. The three men worked on the car's design at night, hoping to sway Lamborghini from the opinion that such a vehicle would be too expensive and would distract from the company's focus. When finally brought aboard, Lamborghini allowed his engineers to go ahead, deciding that the P400 was a potential marketing tool, if nothing more.

The Robb Report story also mentions that the Miura featured brilliant and original engineering. It debuted:

at the 1965 Turin auto show. Though the car lacked a body, showgoers still placed orders for it.

Sunday, October 2, 2011

I Had A Problem And I Decided To Use Regular Expressions...

Now I have zero problems, because I'm not an idiot.

Seriously, regex is its own category of programming language. It's worth learning but like anything else you do have to learn it in order to use it. The problem most people have with regular expressions is not that regexes are in any way more difficult or strange than any other type of programming problem, but simply that most people do not bother to do their homework.

So do your fucking homework.