HACK

GitHub user pages have these awesome charts which shows you a heat map of your year-to-date commits.

For a while I’ve wanted to do some sort of hack with this chart. And today, I finally did. See the result at: github.com/public-contributions.

The basic trick is to make you GitHub commits appear in the past by manually setting --date when committing to the repository. For example, to commit on January 6, 2013, you could run this:

git commit --date="Sun Jan 06 14:00 2013 +0500" -m "Commit message"

To make this process not so tedious, I wrote a script which loops through a list of dates and commits empty files for each date.

Here’s the script in all it’s glory:

#!/bin/sh

while read date
do
fileName=`echo "$date" | tr " " "_"`
date="$date 14:00 2013 +0500"
echo "Creating file... $fileName"
touch "$fileName"
git add "$fileName"
git commit --date="$date" --author="public-contributions" -m "$fileName"
done <dates.txt

The repository public-contributions/HACK, is open source with the MIT License, so fork it, change it, do whatever you want. The README contains instructions to run this hack yourself. If you use it make your own hacks, share them here. Happy hacking.

If you thought this was cool, follow me or star HACK on GitHub.

Loading...