Vandalising your Github commit history because WHY NOT?

Massively over-engineering things is fun

@pikesley

Who am I?

The Github commit calendar

  • Those are addressable pixels
  • We just need to construct the correct incantations

Gitfiti

The Sinclair Spectrum

The font

  • It's a list of bytes
  • Which I procured from some kind soul on comp.sys.sinclair many years ago
  • I previously wrote this in PHP in 2003-ish, and Python in 2010-ish

Building it as a RESTful webservice

This is my boss

Content negotiation

application/json

text/plain

text/html

http://uncleclive.herokuapp.com/

The future is amazing

  • Built test-first, with cucumber
  • Using Sinatra
  • Github
  • Travis-CI
  • Heroku

Pokrovsky

  • So we can write in the Spectrum font on the Github contributions calendar
    • Almost
  • The Spectrum font is 8 units high, the calendar is 7 days high
  • So we sometimes have to chop out some rows

The rules

  • If a character has a blank top row, that row will be excised, else
  • If a character has a blank bottom row, that row will be excised, else
  • rows[4] will be excised

How it actually works

  • Git lets you rewrite history
  • So we look at the contributions history and work out the busiest day from the last year
  • Then for each day where we want to draw a pixel, we make 125% of that number of empty commits
  • So we make a whole load of empty commits with artfully constructed timestamps

Lessons learned

  • Don't use undocumented APIs
  • Be careful when using something like VCR to isolate your tests from the actual APIs

The final result

Extracting the 8-into-7 adapter into a middle tier

What's next

  • Extract the good parts out into a Gem or two
  • Get Uncle Clive to generate PNGs
    • This feels like something I should be able to do but apparently I have no idea what I'm doing

Questions?

@pikesley