Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Introducing (for all your example-app needs)

Hamazon, your Fine Purveyors of Pork Products since 2010, is the default example I use so as to have a consistent example of a software application whenever I tell stories. In the spirit of Convention Over Configuration, it’s helpful to have a go-to narrative rather than inventing a new example for every story.

Read more »

Start Your Own Lunchtime Drawtime

Lunchtime Drawtime is where Pivotal Labs folks get together and draw during lunch. We have Lunchtime Drawtime on Fridays at the NYC office, weekly for the past 6 months. Here’s a list of protips in case you want to start your own Lunchtime Drawtime group.

Read more »

Pair Comics

There are particular tropes that come up again and again when pairing. I’ve decided to canonize a few as comics. Enjoy!


Read more »

SNL tickets!


  • SNL Ticket Lottery Open

    Lottery for SNL tickets is open. Email once during the month of August with full contact details to enter.

Full details at

What Is Your Workstation Tag?

At Pivotal, we love our large, shared workspace and homogeneous workstations. As we move from project to project, our workstations are pretty much the same: iMacs with TextMate, RubyMine, Quicksilver (bound to ⌘+space, of course!) a full Ruby/Rails stack, and a few other applications. Given this minimal setup, I can figure out which developers have used a particular workstation given the extra applications installed upon it. I've come to see certain applications as a developer's "tag," like a graffiti signature.

As for me, if you see Jumpcut and Skitch, then I've tagged your machine.

What are your tags?

How To Create a Fluid Application for Pivotal Tracker

As a developer of web apps, I'm inevitably running 3 or 4 browsers, each with 10 tabs open containing my application under development, Google searches, gotapi (pronounced "got a pie?" of course!), design wireframes, and all kinds of other very important stuff. And in one of those tabs, somewhere, is Pivotal Tracker. Browsers and tabs are great, but sometimes you just want an Application -- notice the capital "A."

Fluid to the rescue! Fluid lets you create Site Specific Browsers, which "provide a great solution for your WebApp woes." In a nutshell, Fluid makes a custom WebKit browser that, when launched, opens just the site you configured it to open, such as Gmail, Pandora, or even Pivotal Tracker. I love that I can maximize the Pivotal Tracker app and boost the font 3 or 4 levels, filling a screen with Tracker goodness without the clutter or navigation buttons, bookmark bars, or tabs. And where is Tracker? Just command-tab!

Here's how to create a Fluid application for Pivotal Tracker.

  1. Download and install Fluid
  2. Download the Fluid Icon for Pivotal Tracker
  3. Launch Fluid
  4. Enter the following:
    • URL:
    • Name: Pivotal Tracker
    • Location: pick one!
    • Icon: pick 'Other...' then find the tracker icon you downloaded earlier
  5. Click Create, then launch it!

Once launched, open the Pivotal Tracker preferences and change the Window Style to "HUD (Black)" under Appearance Preferences Why? Because it looks cool.


Here is the Fluid icon, upon request.

The Law of Demeter is a Piffle

One of The Blabs' most controversial articles was Lovely Demeter, Meter Maid, in which Pivotal and Thoughtworks battle over which Agile consultancy has the better understanding of the Law of Demeter, and which has better hair and music taste (seriously).

I have never found this "law" very persuasive.

  • The bizarre, culturally loaded analogy about a paperboy and a wallet says nothing insightful about encapsulation boundaries as they arise in real software systems.
  • The blogosphere's endless scholastic hermeneutics of the law's 4 allowances for message sending is a masturbatory philosophical enterprise with nothing relevant to real-world software.
  • The Mockist's insistence on easy mockability is of dubious merit--build better mocking frameworks!
  • And the few practical, real merits that arise in from following the Law of Demeter are better arrived at using other techniques, such as "Tell, Don't Ask".

Here Are Two Examples, one where I violate the Law of Demeter, and another where I don't.

I wrote this code recently, in flagrant violation of the Law:

cookies[:store_id] =

Suppose @login is not an ActiveRecord object, it does not automatically have a #store_id method. Should I create a delegator for this?

class Login

  def store_id



This is pretty silly. The store_id is not an attribute of the login; rather it's an attribute of the store, and the store is an attribute of the login. The delegator is needless code cruft to replace a dot with an underscore, it smells of the endless boilerplate Java code of my youth. Demeter be damned.

On the other hand, here is a refactoring I did, incidentally complying with the law of Demeter:

Here is the original, Demeter-violating code:

def find_attribute_given_name(name)

  attributes.detect { |a| a.name_or_alias == name }


The call to == here is the violation of Demeter. I later replaced this with:

attributes.detect { |a| a.named?(name) }

The latter complies with the "law". And it's much better code. But was I lead to the improvement to this by Demeter? No, I was lead to it by a better understanding of the encapsulation boundaries of the object (#name_or_alias became private) and by a desire to have my code be more terse and clear. a.named?(name) is the most terse explanation of the intended computation that I can think of.

Demeter be damned.

Ruby Pearls vol. 1 – The Splat

Over the next week or so I'll be sharing Ruby idioms and flourishes that I quite like. Today I'd I'll show a few tiny uses of splat! that make me tremble with delight.

Splat! - For Beginners

Splat! is the star (*) operator, typically used in Ruby for defining methods that take an unlimited number of arguments:

def sprintf(string, *args)

It can also be used to convert an array to the multiple-argument form when invoking a function:

some_ints = [1,2,3]
sprintf("%%i %%i %%i", *some_ints)

Splat! - For Wizards

Array to Hash Conversion

The best use of splat! for invoking a infinite-arity functions I've ever seen is the recipe for converting an array to a hash. Suppose you have an array of pairs:

array = [[key_1, value_1], [key_2, value_2], ... [key_n, value_n]]

You would like to produce from it the hash: {key1 => value1 ... } You could inject down the array, everybody loves inject, but there is a better way:


Amazing right? This relies on the the fact that the Hash class implements the [] (brackets) operator and behaves thusly:

Hash[key1, value1, ...] = { key1 => value1, ... }

Heads or tails?

Splat! can be used for more than just method definition and invocation. My personal favorite use is destructuring assignment. I read this in Active Record's source code recently:

  def sanitize_sql_array(ary)
    statement, *values = ary

This is invoked when you do something like User.find(:all, :conditions => ['first_name = ? and last_name = ?', 'nick', 'kallen']). Splat! is used here is to get the head and tail of the conditions array. Of course, you could use always use shift, but the functional style used here is quite beautiful. Consider another example:

first, second, *rest = ary

One final trivium (#to_splat aka #to_ary)

You can actually customize the behavior of the splat operator. In Ruby 1.8, implement #to_ary and in 1.9 it's #to_splat. For example

class Foo
  def to_ary

a, *b =
a # => 1
b # => [2,3]

This also works for method invocation:

some_method(* == some_method(1,2,3)

When I first learned this at RubyConf I thought this was mind-blowing. I have since never used it.

Ninja Patching jQuery

Jonathan and I love jQuery's extended psuedo-selectors:

  • :input - Matches all input, textarea, select and button elements.
  • :text - Matches all input elements of type text.
  • :password - Matches all input elements of type password.
  • :hidden - Matches all elements that are hidden, or input elements of type * "hidden".
  • :visible - Matches all elements that are visible.
  • and so on

These aren't actually part of the CSS spec, but they're incredibly useful and can be chained:

$(':input:visible') // => finds all visible inputs

We wanted to customize the behaviors of :text and :visible:

  • We wanted :text to return both <input type="text"> AND <textarea>
  • We wanted :visible to return elements that aren't directly display:none or visibility:hidden, nor are their parents display:none or visibility:hidden

So, we decided to customize this behavior:

jQuery.extend(jQuery.expr[":"], {
  text    : "(a.tagName=='INPUT' && a.type=='text') || (a.tagName=='TEXTAREA')",
  visible : '"hidden"!=a.type && jQuery.css(a,"display")!="none" && jQuery.css(a,"visibility")!="hidden" && (jQuery(a).parent(":hidden").size() == 0)',
  hidden  : 'document != a && ("hidden"==a.type || jQuery.css(a,"display")=="none" || jQuery.css(a,"visibility")=="hidden" || (jQuery(a).parent(":hidden").size() > 0))'

So how would you like to ninja-patch jQuery's custom pseudo-selectors?

Enjoying The New Teas

I'm really starting to enjoy the selection of green teas in the office. I especially enjoy the ones with... well.. $#!+ in them. Popped rice, puffed rice, browned rice, black soy beans, and various other clippings and debris. It's kind of like drinking tea with Rice Krispies in it, but in a good way. And the ingenuiTEA containers are very handy.

The only exception to my new-found enjoyment is a green "tea" named Angel, which must mean the Angel of Death, or perhaps the Angel of Turpentine; it's easily the most foul and bitter substance I have consumed in a very long time.