Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Streak generator. 100 year streak: https://github.com/cirosantilli/test-streak
#!/usr/bin/env python
import datetime
import subprocess
import os
os.system('git init')
# os.system('git config user.name "Ciro Santilli"')
# os.system('git config user.email ""')
date0 = datetime.date(2000, 1, 1)
datef = datetime.date(2200, 1, 1)
DEVNULL = open(os.devnull, 'wb')
date = date0
i = 0
while date < datef:
s = date.strftime("%Y-%m-%dT01:00:00")
os.environ['GIT_COMMITTER_DATE="{0}"'] = s
cmd = ['git', 'commit', '--allow-empty', '--allow-empty-message', '-m', '', '--date', s]
subprocess.call(cmd, stdout=DEVNULL, stderr=DEVNULL)
if i % 1000 == 0:
print s
i += 1
date += datetime.timedelta(days=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.