-
Notifications
You must be signed in to change notification settings - Fork 5
/
hire_me.py
executable file
·50 lines (37 loc) · 1.22 KB
/
hire_me.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/python
from datetime import date, timedelta
from time import sleep
from subprocess import call
today = date.today()
start_date = today - timedelta(days=today.weekday()+2, weeks=52)
# should correspond to the first contribution box on github
# print start_date.ctime()
matrix = """
.......................###.......##.......##........
........................##.................##.......
........................##.#....###...##....##......
........................###.##...##.........##......
........................##..##...##...##....##......
........................##..##...##........##.......
.......................###..##..####......##........
"""
lines = matrix.strip().split("\n")
columns = zip(*lines)
counter = 0
call(['rm','-rf','.git','delta.txt'])
call(['git','init'])
def write_delta(d):
f = open('delta.txt', 'w')
f.write(str(d))
f.close()
call(['git','add','-A'])
call(['git','commit','-am','Initial commit'])
for c in columns:
for d in c:
counter += 1
if d != "#":
continue
# print d, (start_date + timedelta(days=counter)).ctime()
write_delta(counter)
call(['git','add','-A'])
call(['git','commit','--date',(start_date + timedelta(days=counter)).ctime(),'-am',str(counter)])