How to create your own pixel graffiti on GitHub contribution board

Time:2020-9-8

Tired of work? Body deficiency? No time to submit code? Isn’t it frustrating to see 0 contributions in the last year on your GitHub home page? Don’t worry, now you can not only make up for your vacant time, but also create your own unique pixel graffiti works on it, draw a love to express your love to TA, paint a cake to commemorate your birthday, and give full play to your creativity.

Gayhub, oh no, GitHub’s friends, should all know that GitHub has a contribution section on its homepage. It shows you in a specific period of time with different colors

The number of times you hand in, the darker the color, the more times you commit that day. However, we always feel that there is a big difference between our contribution panel and the boss.

GitHub of other people’s house:

How to create your own pixel graffiti on GitHub contribution board

My GitHub:

How to create your own pixel graffiti on GitHub contribution board

Looking at other people’s green, and then looking at your own 0 contributions in the last year, is it a little sad?

When I was idle and bored, I studied what rules GitHub contribution board was based on and found that it was still dynamically generated.

What is dynamic generation?

That is to say, GitHub will count the commit status of all warehouses you created in real time when generating the contribution thermal map. For example, you have a warehouse A, and warehouse A is in progress one day

Commit the operation, then a small green dot will appear on the corresponding date on GitHub’s contribution board. The color of the small green dot is directly proportional to the number of times you commit (but not

But when you delete warehouse A from GitHub, the small green dot will disappear, which is called dynamic generation. (the contribution panel of gitee code cloud in China is one time

After the green dot generated by sex is generated, it will not disappear with the deletion of the related warehouse, please operate with caution!)

What are the specific rules for the depth of small green dots? How many times will it take to make the deepest green?

I didn’t find any explanation about this rule in GitHub official, but some big guys on the Internet may have tried it out by themselves.

How to create your own pixel graffiti on GitHub contribution board

There are even comments about emails sent to GitHub officials, but this is confidential?

How to create your own pixel graffiti on GitHub contribution board

Ha ha ha, the estimation details may not be accurate. After all, people’s officials are not willing to say that there must be unknown secrets, but the general rules must be different from those mentioned by the big man in the figure above

Not much.

With all that said, how can we make any changes to the contribution panel? Will time go back?

The key point is time.

In fact, the commit time counted by GitHub depends on the commit time recorded in Git warehouse, and the time submitted to git warehouse can be modified.

Since I was not familiar with git command, I thought of changing the commit time by modifying the system time, and found it feasible.

Later, we found that the commit command has a — date parameter, which can be used to customize the submission time. The format is:

Git commit -- date = month day time year + 0800 "- M" submit "

For example:

Git commit -- date = "May 7 9:05:20 2016 + 0800" - M "submit"

In this way, you can use the past time to submit. However, we need to pay attention to GitHub’s statistical time. According to the official statement, it is based on UTC time, but I found that it seems that

It is related to the time zone of GitHub server location. The server I visited guessed that the time difference between San Francisco and Beijing time is 16 hours, that is, if you want GitHub to count the time

It’s 0:00, so you have to set Beijing time to 16:00.

How to create your own pixel graffiti on GitHub contribution board

We have implemented the custom submission time, and the next thing will be easy to do. If we want to implement arbitrary graffiti on GitHub contribution board, we only need to know which day we need to

The number of commit times is good. The custom submission time is used to determine which grids we want to have color. The number of commit times determines the color depth. In this way, we can use the two methods

Combined, we can easily create our own pixel style graffiti.

The principle is so simple, pure boring, if you also want to play, you can follow the method to try.

If you find it troublesome to write, you can also use the tools I have written directly.

Project address: https://github.com/qinshuang1…

As like as two peas, you can create a designer contribution board that is exactly the same as Github, and you can control the color of the grid by clicking the mouse on it. HTML

To draw the graphics you want, and finally click export to generate one out.qs And then use the commit.py The python script reads it and commits to the local git repository

The operation is good (you need to prepare a git repository in advance for operation, and the file path and other parameters in the script need to be changed by yourself). After running, push your local warehouse to

GitHub, then you can see your own design of pixel graphics (generation time is uncertain, 24 hours possible).

How to create your own pixel graffiti on GitHub contribution board

I used this in the year I was born to draw a birthday pixel pattern, also with a cake, ha ha ha, you also have a try.

How to create your own pixel graffiti on GitHub contribution board

Art is everywhere. GitHub should not let it go.

Note: this project is for entertainment only, please do not use it in improper way! This project will not be responsible for any disputes.

Recommended Today

DK7 switch’s support for string

Before JDK7, switch can only support byte, short, char, int or their corresponding encapsulation classes and enum types. After JDK7, switch supports string type. In the switch statement, the value of the expression cannot be null, otherwise NullPointerException will be thrown at runtime. Null cannot be used in the case clause, otherwise compilation errors will […]