Created
February 14, 2021 17:32
-
-
Save pauliusbaulius/6bf74987d68765335d4c278c091d336f to your computer and use it in GitHub Desktop.
lil github cheat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
lil github cheat | |
you feel peer pressure to maintaing active github constribution graph? | |
you feel like this feature sucks? | |
your real contributions are done at work to private repositories and you still want to flex? | |
use lil github cheat to flex that green contribution matrix | |
how do i? | |
1. (opt) set range for commits, default is 1 to 10. | |
2. add path to git repo, make sure it is a repo, this does not create new repo. | |
3. chmod +x lgc.py | |
4. add this script to your crontab | |
0 8 * * * ./path/to/lgc.py | |
""" | |
from random import randrange, choice | |
from string import digits | |
from time import sleep | |
import os | |
LOWER_BOUND = 1 | |
UPPER_BOUND = 10 | |
GIT_REPO = "/Users/pauliusgerve/Dev/lgc/" | |
COMMIT_MESSAGES = [ | |
"bug fixes & improvements", | |
"critical ticket resolution", | |
"fixed a bug", | |
"...", | |
] | |
COMMITS = randrange(LOWER_BOUND, UPPER_BOUND) | |
def git_cheat(): | |
os.system( | |
f"cd {GIT_REPO} && git add lol && git commit -m '{choice(COMMIT_MESSAGES)}' >/dev/null" | |
) | |
def create_data(): | |
with open(os.path.join(GIT_REPO, "lol"), "w") as f: | |
f.write("".join([choice(digits) for x in range(255)])) | |
for _ in range(COMMITS): | |
create_data() | |
git_cheat() | |
sleep(randrange(1, 10)) | |
os.system(f"cd {GIT_REPO} && git push origin master >/dev/null") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment