Taking 12 months to upload a 52x7 pixel image, through thousands of git commits, ... that's completely reasonable right?
The quest started on 15th March 2021 📜
And here we are 712 fake commits in:
We've just reached roughly the halfway point, with half of the letter 'M' visible. You can see the result 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.
I've really made the most of my degree.
I want! I want! I want!
I know you do. And you can have.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.
Basically, you just need to make your image (e.g. in MS paint): Then create an empty private repository, which will get filled with fake commits. Also change some GitHub settings, and get an authentication token. Then change a little configuration file:
{
"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 a binary (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 are really desperate. 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 use the Windows Task Scheduler, or if you are super enthusiastic and like cloud stuff, setup an event-driven serverless function which gets triggered each day (e.g. Azure Functions).Of course you then need to wait a year to see the results. Maybe try doing something useful in that time, ... or not.
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 idiot-proof.
How it works
When the process runs on a particular day...- It looks at your image, and finds the pixel it needs to upload that day
- It maps the colour of the pixel to the closest GitHub heatmap colours (one of 4 shades of green)
- From that it determines the amount of activity required to produce that colour on the heatmap
- Then it sends some requests to GitHub's Event API, to work out the amount of activity you have already performed that day
- Calculating the difference between the activity level needed, and the today's activity so far, it works out how many fake commits it needs to make
- Then it uses GitHub's API to push commits to the repository, each commit containing a small text file
- 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
Btw, 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
Post a Comment