It was pretty much a hack; first, I read the colours straight off the shirt, producing a big block of data like
0002342 2223322 2323241 2224333 3322122 2242231 ...
Then we read that in one digit at a time, work out what day to start on so everything aligns correctly, and how many commits on a given day produce each gradient of colour. The result isn’t pretty:
Three times so this thing will scroll on for the next few years. Other values
tbl would work too; I just didn’t bother to do anything better. I’ve
written clearer code, but that wasn’t really the point either.
I actually screwed this up twice: first I didn’t remember to treat the
entries correctly (i.e. I should have skipped those days, whereas I ignored
them entirely); second, it seemed like I was getting hit by timezone issues
where everything was shifted up a block.
In retrospect, I should have first produced a mini-contributions graph generator (i.e. one that takes a Git repository and produces what GitHub would do), validate that against an existing user/repo, then use that to ensure it’d work the first time. I did a similar thing to ensure I had the data correct, by producing a graph directly from the data: