Skip to main content

Fill your GitHub activity heatmap with the image of your choice

Taking 12 months to upload a 52x7 pixel image, through thousands of git commits, ... that's completely reasonable right?


This is a tool will, over the course of 12 months, upload a 52x7 pixel image, by making thousands of git commits, ... to fill in your GitHub activity heatmap.

Currently I'm 712 fake commits in:
This is roughly the halfway point, with half of the letter 'M' visible. You can see the result (at the time of writing at least) for yourself on my GitHub Profile Page.

This is what the masterpeice will look like when complete, viewed using GitHub's light and dark themes:
It will then continue to repeat itself over time, like a really slow news reel.



Its fairly simple to set this up on your own GitHub account. I made a GitHub repository containing all the code and instructions you need.

First you need to make your image (e.g. in MS paint):
Then create an empty private repository, which will get filled with fake commits. You'll also need to change some GitHub settings, and get an authentication token. Then change the tool's configuration file to include your authentication token and repository details:
{
	"auth": {
		"type": "token",
		"token": "GITHUB_PERSONAL_ACCESS_TOKEN"
	},
	"repo_name": "REPO_NAME",
	"repo_owner": "REPO_OWNER",
	"image_file_name": "art.bmp",
	"start_date": "14032021",
	"test_mode": false
}
And finally setup a scheduled task to run the tool (buit for Windows, Mac or Linux) on a computer which is always turned on at that time each day. Or run it yourself manually every single day if you don't trust scheduling. For example, I use a server (an Azure cloud VM), which I always have running, and it's Linux, so I created a CRON job to run at 11:30pm every day. For Windows you can alternatively use the Windows Task Scheduler, or there countless other ways to trigger it.

Then simply wait a year to see the full results.

All the files you need are on the GitHub releases page, and detailed instructions are in the repo's readme. The instructions and binary executable itself, are both very easy to use.

How it works

When the process runs on a particular day...
  1. It looks at your image, and finds the pixel it needs to upload that day
  2. It maps the colour of the pixel to the closest GitHub heatmap colours (one of 4 shades of green)
  3. From that it determines the amount of activity required to produce that colour on the heatmap
  4. Then it sends some requests to GitHub's Event API, to work out the amount of activity you have already performed that day
  5. Calculating the difference between the activity level needed, and today's activity so far, it works out how many fake commits it needs to make
  6. Then it uses GitHub's API to push commits to the repository, each commit containing a small text file
  7. Although the repository is private, these commits count towards your GitHub activity, hence when someone views your profile, the commits that have been made each day, form pixels of the heatmap image
Warning: If the tool runs early on in the day it'll generate exactly the right number of commits. However, if you then make further commits or PRs or new repositories yourself, there will be more than the desired amount, so you'll see a darker shade of green. Hence it's best to set the tool to run at a time later in the day, at a point where you have typically finished all your daily GitHub activity.

The code is open source and written in C# using .NET Core 3.1. You can build and compile it yourself if you want to make changes.

Comments

Popular posts from this blog

Terminals in Sublime Text 3

If you need a quick answer on how to create terminals in Sublime Text 3, watch the following video, or read the instructions below it. How to set up Terminals in Sublime Text 3 Open Sublime Text. Open the Command Palette with Crtl+Shift+P Type  'Package Control: Install Package' until the option appears and select it [You'll need to install package control if you are using it for the first time] Type 'Terminus' and select it. Now the package Terminus will install. Wait for this to complete. Then restart Sublime Text. Next we will add Commands to the Command Palette. So you can open terminals using Crtl+Shift+P then typing a command. To do this open the Command Palette (Ctrl+Shift+P) and type 'Terminus: Command Palette' and open it. You'll be greeted by a split view. Basically there are settings defined in the code on the left panel and you can override them or add your own by typing code in the right panel. Copy ...

Generating a MSI Installer for a WPF Application

This post serves as a tutorial for creating a MSI installer for your WPF Applications in Visual Studio. For this we use WiX (recommended by Microsoft). Prerequisites I assume you already have a Visual Studio solution containing a WPF Project. And I assume you have some experience with Visual Studio and XML. You do not need any prior knowledge of WiX. Step 1: Install Wix We are going to need WiX to generate our MSI. If you don't already have Wix installed, go ahead and download it from here . You'll be redirected to the relevant GitHub releases page where you can download the .exe file to install WiX.