Skip to content

Instantly share code, notes, and snippets.

@cirosantilli
Last active July 3, 2018 12:23
Show Gist options
  • Save cirosantilli/4d24fc646ab9aec8def7 to your computer and use it in GitHub Desktop.
Save cirosantilli/4d24fc646ab9aec8def7 to your computer and use it in GitHub Desktop.
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