Skip to content

Commit 4d08e16

Browse files
committed
Initial commit
0 parents  commit 4d08e16

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
hello
2+
=====
3+
4+
Say hello to GitHub.

gen.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import Image
2+
import os
3+
from datetime import datetime
4+
from datetime import timedelta
5+
6+
7+
def add_commits(date, n=1):
8+
for i in xrange(n):
9+
os.system('git commit -m ! --allow-empty --date="%s"' % date)
10+
11+
12+
def process(im):
13+
assert(isinstance(im, Image.Image))
14+
im = im.convert('1')
15+
xsize, ysize = im.size
16+
date = datetime.now() - timedelta(xsize * ysize)
17+
step = timedelta(1)
18+
19+
for x in xrange(xsize):
20+
for y in xrange(ysize):
21+
pixel = im.getpixel((x, y))
22+
23+
if pixel == 0:
24+
add_commits(date.isoformat(), n=20)
25+
26+
date += step
27+
28+
29+
if __name__ == '__main__':
30+
im = Image.open('hello.png')
31+
process(im)

hello.png

166 Bytes
Loading

0 commit comments

Comments
 (0)