Jon "Lark" Larkowski

Rails Developer at http://www.pictureofhealth.com

Saturday, May 30, 2009

Pair Programming & git & github & Gravatar & You & You

Or, how Hashrocket displays pair programming gravatars on github.

The Peculiar Problem of Pairs

At Hashrocket, we pair program all the time. We also use git exclusively for source control. This presents a problem: git only supports one “commiter,” but we’d like to give credit to both developers. Here’s how we hacked it.

Author vs. Committer

First, a bit of background: git does support the notion of an “author” as distinct from a “committer.” This feature handles the situation where some external third-party developer has submitted a patch to a source maintainer. The maintainer, as the authoritative and github-credentialed “committer,” can commit the changeset for the external developer, who is set as the “author.” Both the author and the committer are recorded in the commit data.

We did think about setting one pair developer as the author, and the other as the committer. But, then we thought of something we think is even sexier.

Set the Pairs in the Author Fields

Unfortunately, git only supports one “author” as well. But, the author fields do provide us a workable place to hack in our pair attribution solution: we concatenate and store both pair developers usernames in the those author fields. In the BASH shell, that goes a little something like this:

bash$ export GIT_AUTHOR_NAME='Jon Larkowski and Tim Pope'
bash$ export GIT_AUTHOR_EMAIL=dev+l4rk+tpope@example.com

The convention we use for GIT_AUTHOR_EMAIL is the form: dev+pair1+pair2@example.com where “dev” is short for “developer.” dev is just an email alias that goes to every developer at Hashrocket. The pairs are added in alphabetical order by github username. We hack our usernames into the email address using the “plus-notation” feature of email addresses.

Configure the Committer

Committer for a Developer’s Laptop

As for the committer field, it’s just the developer whose machine you’re pairing on. This allows us to tell which user this commit came from, while still indicating the pair authors. Also, it allows us to simply use that developer’s github credentials for pushing up changes. So the git log --pretty=full after a commit looks something like:


commit 3eb7b3a155f11e56cf406f2b09dc2fd98e92b532
Author: Jon Larkowski and Tim Pope <dev+l4rk+tpope@example.com>
Commit: Jon Larkowski <jon@example.com>

   Ebony and ivory, live together in perfect harmony.

Committer for a Shared Pairing Workstation

We do have one twist on the committer. More and more, we’re using communal desktop machines at Hashrocket. We have a couple Macs Pro and a couple Macs Mini (I assure you, those are the proper irregulars plural, look it up). On these shared machines, we name the committer after the machine’s name. This allows us to know which machine a commit came from, but it’s not attached to any particular developer’s name.

bash$ git config --get-regexp user\.*
user.email dev+some_workstation@example.com
user.name Some Workstation

Also, note that the shared development workstation will need to have its own public key registered on github, under your organization's main github account, not your own personal one.

github & Gravatar Photos

github displays a Gravatar photo next to a username when displaying commit information. This helps add to the “social” feel of github.

Single Developer Gravatar Photo

For you as a lone developer, github just looks up that gravatar based on the email address you gave github when you signed up.

Developer Pair Gravatar Photo

Now for a pair, we need a unique email address that github can use to look up a photo on gravator. This is where our pair developer email address convention comes into play. We just add that dev+pair1+pair2@example.com as a new email address under our main corporate gravatar account, which is maybe signed up under info@example.com for instance.

Gravator lets you have as many email addresses as you one under one main umbrella account. It’s a bit spammy, in that every developer will receive a gravatar confirmation email whenever a new pair permutation signs up. But, that sounds like a “First World problem,” if I ever heard one.

Say, “Cheese!”

We typically just snap our pair photos using Photo Booth.app, since we’re likely pairing at that very moment on a Mac with a built-in iSight camera. Oh, and since we’re picky, we make sure that pair1 is on the left and pair2 is on the right of the photo.

Hitch

Setting git environment variables by hand every time you switch pairs could get tedious. Ro and Les wrote a little gem called “Hitch” that makes this easy.

Install it with:

sudo gem install therubymug-hitch

To set it up, follow the prompts and answer the questions:

hitchrc

When you start pairing with someone, just call:

hitch your_pairs_github_username

To code solo:

unhitch

To pick from the list of your previous pairs:

hitch -i

Just running hitch, with no arguments, will tell you who you are pairing with. Pro tip: Add it to your bash profile to see it when you start a shell.

Bonus, can hitch/unhitch from within vim, i.e.

:!hitch github_username

Hardcore BASH Scripting Action

Here's a BASH script that accomplishes the same thing as hitch.

To set up a pair:

bash$ pair fry bender
Bender Bending Rodriguez and Philip J. Fry

To enter a pair that's not a declared variable at the top of the script:

bash$ pair fry hypnotoad="All Hail the Hypnotoad"
Philip J. Fry and All Hail the Hypnotoad

To persist a pairing, even between shell invocations:

bash$ pair -w zoidberg bender
Bender Bending Rodriguez and Dr. John Zoidberg

Use pair with no arguments to see who's paired. Use pair -w with no arguments to clear a persistent pairing.

Sunday, April 05, 2009

Bizness on Rails, Part 1: Why Rails is so Wicked Awesome

On March 3, 2009, Sandro and I gave a presentation at the University of North Florida, for a meeting of the Association for Computing Machinery.

The talk is split in two: the first half covers why Rails is so wicked awesome, the second half covers The Hashrocket Way, our company's not-so-secret, but oh-so-tasty recipe for Agile process management.

Here's a video of the first half. The second half will come out later, parceled out as a series of short-form videos covering Hashrocket's agile processes one-by-one.

Thanks to ACM and UNF and super-nice guys, Giancarlo Wieser and Jason Monsorno, for hosting us!

The Way I Getting Things Done

On January 29, 2009, I spoke about my own special productivity sauce at the Refresh Jacksonville Pecha Kucha Night. Pecha Kucha is a rigid presentation format: twenty slides, twenty seconds each. Talk about embracing constraints! Definitely forces you to get to the point and sit back down. This was my very first Pecha Kucha talk, and it was fun as hell.

In general, I cover the what applications and particular techniques I use. The last part of the talk covers the importance of guarding your attention for focused creative work, and firewalling big blocks of time for the big important areas of your life.

Topics Covered

Thanks to Jim “Big Tiger” Remsik and Joey Marchy for putting a killer fun night together! And thanks to Sandro’s parents for bringing cake and margaritas for his birthday! A terrific cap to the evening.

Other Coverage

Thursday, March 19, 2009

You know you've arrived when...

...when your local coffee shop starts promoting a drink named after your company. (Haha, you got it official, Tiger.)

Special thanks to Coffee Bistro in Jacksonville Beach, FL, serving all our caffeination needs since 2009.

Update: I believe the "Hashrocket" is a vanilla chai with a shot of espresso in it.

Wednesday, March 18, 2009

MLK Hack Day 2 this Saturday the 21st at Hashrocket

Come hack some open-source Rails with us at Hashrocket this Saturday the 21st at the Hashrocket offices. We're adding hot new features to our localpolitics.in site. Read my blog post about the first Hack Day for some context.

We're gonna get some sunshine at the beach for bit in the afternoon, so bring your Speedo's. See you cats there! 9am sharp, or whenever you typically wake up on Saturdays. We'll be hacking most of the day/night.

Sunday, March 01, 2009

Acts as Conference Wrap-Up

From the Shit-I-Shoulda-Posted-Last-Month Department…

My talk at Acts as Conference talk went great!

Photo credit: Sandro Turriate

You can watch the video, thanks to Confreaks. You can also read the slides as a PDF (they’re little jumbled, but mostly OK).

Love those regional conferences. Better, smaller, shared experience. More human. Thanks again to Robert Dempsey, for a great conference.

Also, read Cory Foy’s roundup.

Sunday, February 22, 2009

Hashrocket's Martin Luther King Jr. Memorial 2009 Hack Day Apps for America Celebrity Rabies Awareness Pro-Am Fun Run Race For The Cure

From the Shit-I-Shoulda-Posted-Last-Month Department…

Approaching the eve of the Obama inauguration, the president-elect made a national call to service. Our consultancy was just then moving into our brand-new office on Jacksonville Beach, Florida. Being a technical bunch of web developers, we decided to put our programming skills to charitable use. We wanted to see what we could hack out in a day. Plus, what an auspicious and fun way to break in our new office.

We had recently heard of the Apps for America web site challenge, which is an effort to promote government transparency by exposing public data via new web site interfaces. It seemed forces were aligned, so we grabbed whoever was willing to code that day, and we went for it.

Sixteen hours later we launched http://localpolitics.in/ The site simply asks a citizen for their zip code, and returns a page showing their congress people, and a list of the top ten presidential campaign donors. Our initial feature-set was purposely small. We just wanted to get the ball rolling. But we've set the stage for easily consuming and presenting data from the Sunlight Labs, and similar web data services.

It's exciting to see what can be pushed out in a day on the web. Interesting times. Big thanks to all who participated! Especially Dennis Eusebio, from Thought + Theory, who gave us a killer design on short notice, and who stuck it out to the very end late at night.

Now, we have to decide if/when we go for a Round Two. Apps for America submissions are due on March 31st. Winners will be announced on April 7th.

Other Coverage

The Hackers

Original Post on usaservice.org

http://www.usaservice.org/page/event/detail/dayofservicejanuary19/4v95k

Hack on code at the beach! Put your technical skills to their best use for charity. We're a fun bunch of developers who live at the beach. Our company, Hashrocket, is hosting a hack day. Our plan is to develop an "Apps for America" web site (http://sunlightlabs.com/appsforamerica/). It's not about the money, it's about coding for a cause.

Monday, January 26, 2009

Speaking at Acts as Conference

I’m excited to speak at Acts as Conference this year. I’ll be giving a modified version of my talk, Testing as Communication, which I gave at the Professional Ruby Conference last November (see wrap-up post). I’m reworking and enhancing my core talk a bit to emphasize the theme of the conference: software development in tough economic times. I’ll cover business-as-usual testing at Hashrocket, and:

  1. how our agile methods like pairing, stories, and diligent testing actually save us time
  2. how each of our tools and techniques enhance client communication, but with low overhead, and minimal workflow interruption
  3. how we deliver early and often (constantly, actually)
About Acts as Conference Acts as Conference 2009 is a two-day Rails conference that will make you a more competitive Rails developer by learning from those driving the innovation that is fueling the Rails community. Held February 6th and 7th in Orlando, Florida, Acts as Conference features a great speaker lineup, free food, a chance to meet with Rails innovators, and a live via video Q&A session with David Heinemeier Hansson. At $125 dollars and limited to 175 attendees, the conference will sell out fast, perhaps faster than last year. Register today at http://www.actsasconference.com. See you there!

Saturday, November 22, 2008

Pro Ruby Conference Wrap-Up

The Professional Ruby Conference in Boston was maybe my favorite conference yet. I really dug the intimate feel. And the single-track approach gave all attendees a common thread to engage around. It was also my first big-time talk. Rock on. Photo credit: Sebastian Delmont The best part for me was seeing how one little slide at the end of my talk can make all the difference. I showed the Ruby community some love, and it came back to me many times over. It makes me feel, I dunno... vital, alive and, well, human to be a part of such a progressive, smart community. That's what I think most of us want, in the end: to engage with kick-ass people, advance the state-of-the-art, and have a blast while doing so. Thanks to everyone at the conference, and in the community, for making that a reality. And thanks to Barbara, Debra, Olivia and people I don't even know about for organizing a great conference. Here's to the next one! Other coverage:

Saturday, November 15, 2008

RubyJax turns one years old!

"Our little RubyJax is all growns up! He's growns up and he's growns up and he's growns up!" - with apologies to Vince Vaughn in Swingers
It's been over a year since I came to Hashrocket. (Actually, I came to Hashrocket before there was a Hashrocket, but that's another story.) New in town, I was disappointed that there was no Ruby users group in Jacksonville.
Thank goodness I went to that Refresh Jacksonville tech meetup. I met a bunch of great people at that meeting. Among them, a young man named Steven Bristol, of a company you may know, Less Everything. He'd been wanting to start a Ruby group, and I was certainly motivated to start one as well.
My long-time friend, and fresh Hashrocket hire,  Jim "Big Tiger" Remsik soon joined the fray, and RubyJax was born. Our first meeting was very well-attended and very encouraging!
Since that first fateful meeting, we've covered a wide range of topics:
  • RSpec
  • bash shell
  • spider testing
  • advanced ActiveRecord
  • Amazon EC2 & S3
  • haml and sass
  • pair programming
  • jQuery, prototype, the Less Js Routes Plugin
  • best practice patterns
  • vim vs. TextMate
  • testing
  • website performance tips and tricks
My particular favorites were the pair programming, and "code & coffee" hack sessions. I'd like to see more of those in the future.
We've also had some great guests, including: some guy named Obie who is big into Rails or something, Desi McAdam who runs DevChix, Tim Pope who is rails.vim, Rein Henrichs who is for the moment slightly better than me at ping pong, Wilson Bilkovich of Rubinius and Engine Yard fame, and most recently Will Reed from ask.com.
It's been a great year. I've met some amazing people through this group. And with the exception of Steve, everyone is sharp and engaging and just generally pleasant to hang around with. ;) So, what's in store for next year? I think Big Tiger says it best:
"RubyJax is, exactly, no more and no less than what you make it."
Here's to RubyJax in 2009! Thanks, beloved members, for taking the time.
# Lark
Usual links: * http://rubyjax.com * http://meetup.com/rubyjax * http://groups.google.com/group/rubyjax * #rubyjax on irc.freenode.net * gcal: http://www.google.com/calendar/embed?src=4l89gdt6toa7ub2io9p6tgpfi8%40group.calendar.google.com&ctz=America/New_York


Photo credit: Sebastian Delmont

Subscribe Now: Feed Icon