Weekly Digest, 3-15-09

Trevor’s Links

timocratic’s test_benchmark

Rails plugin (and/or ruby gem) for benchmarking your test::units. [This has to be one of the best gems I’ve come across in a while. A+++]

Slow tests are a bug

Most Rails projects I’ve worked on have ended up at around 3,000-15,000 lines of code, with a roughly as many lines of test code, and most have test suites that take a minute or more to run. Our test suite for Tumblon, for instance, churns along for 2.5 minutes. This is a too slow. And slow tests are a problem for at least two reasons: they slow down your development and decrease code quality. [Note the awesome plugin linked in the comments!]

Sinatra block parameters

The latest master Sinatra now supports optional block parameters. It captures any parameters in the URL and passes them into the block that defines the action.

When Overusing self Turns Into self.pity

Wow, so simple. Much easier on the eyes, and the intention is clear right from the start. My rule is simple: When assigning to an instance variable, use self, calling a method on the other hand should stand all by itself. Now, you could argue, that assigning to an instance variable using its accessor is also a method call, but if you really want to argue about that, you should really read this blog entry again.

Temporarily disable ActiveRecord callbacks

I was recently working on a client project and I had to create a rake task to import a large set of data from a spreadsheet. One of the models that was being imported had an after_save callback that sent out an email notification. I didn’t really want 3500 emails to be sent out whenever this rake task was ran, so I needed to disable the callback while the import task was running.

Readability

Reading anything on the Internet has become a full-on nightmare. As media outlets attempt to eke out as much advertising revenue as possible, we’re left trying to put blinders on to mask away all the insanity that surrounds the content we’re trying to read.

state_machine

After 2 1/2 years… I’m finally officially announcing a project I’ve been quietly working on: state_machine… This is a project which has undergone many rounds of rewrites, but which has finally met its goal, in my opinion, to become the easiest, sexiest, yet most powerful state machine library for the Ruby language.

The size of social networks – Primates on Facebook

Several years ago an anthropologist concluded that the cognitive power of the brain limits the size of the social network that an individual of any given species can develop. Extrapolating from the brain sizes and social networks of apes, Dr Dunbar suggested that the size of the human brain allows stable networks of about 148. Rounded to 150, this has become famous as “the Dunbar number”.

The 5 P’s of Twitter’s runaway success

Actually, I think we enjoy claiming we can’t describe what Twitter is, yet a closer inspection of it yields not only a better understanding of it but also why it’s become so prevalent in the media lately. And when that kind of inspection occurs, it’s not surprising to the inspector why Twitter is where it’s at today.

Twitter = YouTube

YouTube now gets more searches than Yahoo, Google’s closest search rival. YouTube was the single fastest growing new form of search on the Web, and Google pretty much outflanked (and outspent) everyone to buy it. Not to get into video monetization, per se, but to harvest and control the most important emerging form of search. In short, Google could not afford to NOT own YouTube.

Timothy’s Links

Monsanto is Putting Normal Seeds Out of Reach

This week’s "Rage at the Mega Corps like Lear on the Heath" post is about Agricultural Goliath, Monsanto. Monsanto, a Mega Corp whose operational expenses are almost fully subsidized by our federal government here in the States, has gained much notoriety for sabotaging independent farming operations and, more importantly, running anyone who doesn’t farm their brand of genetically modified corn out of business by installing puppet legislators in important positions or simply using its powerful lobby to write its own legislation and have dupes (like Illinois’ own Michael Madigan) push it through.

contxts – mobile sms business cards

This is my gadget/widget par excellence du jour: basically, you give their database your basic contact info and then, if anyone SMSes your username to 50500, they get your contact info back. Nifty.

High Performance Web Sites

This is a good checklist to run through whether you’re working up a framework from scratch and need to keep optimization principles on a front burner or whipping up a quick, stop-gap kind of ap that needs to work lickety-split with a minimum of fuss.

7 Badass Cartoon Villains Who Lost to Retarded Heroes

What else can you say about cracked.com? They’re on focus, on message and on point.

Secure deletion: a single overwrite will do it

This article has some simple stats that supposedly debunk the urban legend that you’ve got to write zeroes (or whatever) over the whole disc to securely delete a HDD. It doesn’t so much debunk, however, as it makes a point not unlike PGP’s point: the obscurity provided by a single over-write is /pretty good/, but not perfect. Your best bet is still the Gauss rifle…I mean degausser.

Wildwood Survival – Fire Basics

The original survival skill is, of course, making fire. You can never know too many different ways to a.) start or b.) build a fire: file this under "urban, suburban and rural survival tips"

24 Samsung SSDs get strung together for supercomputer fun

This is an article with still pictures (instead of moving ones) that outlines the viral video sweeping the Interwebs in which a plucky admin wires 24 flash drives into a single, desktop-size case.

10 common mistakes using robots.txt

This is totally rudimentary–it’s written more for the copyeditor/SEO enthusiast in your shop, not for the cowboy/console man–but it’s a good reminder of syntax for ye olde robots.txt file. Remember: there’s no notification if your robots.txt file doesn’t parse right…except for deprecated levels of your site showing up in Google.

Mdadm Cheat Sheet | MDLog:/sysadmin

This will be utterly useless to anyone who isn’t experimenting with software RAID on 2.26 kernels. For those of you who are just getting your feet wet with mdadm (e.g. YT), this crib-sheet is a nice resource. That might just point out some things you would otherwise have to plumb the dreaded man page for.

Published by

Trevor Turk

A chess-playing machine of the late 18th century, promoted as an automaton but later proved a hoax.