cleaning up
This commit is contained in:
@ -1,7 +1,5 @@
|
|||||||
gitfiti _noun_ : carefully crafted graffiti in a github commit history calendar.
|
gitfiti _noun_ : carefully crafted graffiti in a github commit history calendar.
|
||||||
|
<img src='https://raw.github.com/gelstudios/gitfiti/master/pixels-large.png' alt='gitfiti art'/>
|
||||||
<style>img{image-rendering: optimizeSpeed; }</style>
|
|
||||||
<img src='https://raw.github.com/gelstudios/gitfiti/master/pixels.png' alt='gitfiti art' height='28' width='204'/ style="image-rendering: optimizeSpeed;"/>
|
|
||||||
|
|
||||||
`gitfiti.py` is a tool I wrote to decorate your github account's commit history calendar by (blatantly) abusing git.
|
`gitfiti.py` is a tool I wrote to decorate your github account's commit history calendar by (blatantly) abusing git.
|
||||||
|
|
||||||
@ -25,8 +23,4 @@ Fortunately if you regret your gitfiti in the morning, removing it is fairly eas
|
|||||||
- ...
|
- ...
|
||||||
- Profit?
|
- Profit?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
23
gitfiti.py
23
gitfiti.py
@ -19,6 +19,15 @@ kitty=[
|
|||||||
[0,0,0,3,4,4,4,4,3,0,0,0]]
|
[0,0,0,3,4,4,4,4,3,0,0,0]]
|
||||||
|
|
||||||
oneup=[
|
oneup=[
|
||||||
|
[0,4,4,4,4,4,4,4,0],
|
||||||
|
[4,3,2,2,1,2,2,3,4],
|
||||||
|
[4,2,2,1,1,1,2,2,4],
|
||||||
|
[4,3,4,4,4,4,4,3,4],
|
||||||
|
[4,4,1,4,1,4,1,4,4],
|
||||||
|
[0,4,1,1,1,1,1,4,0],
|
||||||
|
[0,0,4,4,4,4,4,0,0]]
|
||||||
|
|
||||||
|
oneup2=[
|
||||||
[0,0,4,4,4,4,4,4,4,0,0],
|
[0,0,4,4,4,4,4,4,4,0,0],
|
||||||
[0,4,2,2,1,1,1,2,2,4,0],
|
[0,4,2,2,1,1,1,2,2,4,0],
|
||||||
[4,3,2,2,1,1,1,2,2,3,4],
|
[4,3,2,2,1,1,1,2,2,3,4],
|
||||||
@ -75,6 +84,7 @@ hireme=[
|
|||||||
images={
|
images={
|
||||||
'kitty':kitty,
|
'kitty':kitty,
|
||||||
'oneup':oneup,
|
'oneup':oneup,
|
||||||
|
'oneup2':oneup2,
|
||||||
'hackerschool':hackerschool,
|
'hackerschool':hackerschool,
|
||||||
'octocat':octocat,
|
'octocat':octocat,
|
||||||
'octocat2':octocat2,
|
'octocat2':octocat2,
|
||||||
@ -102,6 +112,7 @@ def max_commits(input):
|
|||||||
def multiplier(max_commits):
|
def multiplier(max_commits):
|
||||||
"""calculates a multiplier to scale github colors to commit history"""
|
"""calculates a multiplier to scale github colors to commit history"""
|
||||||
m = max_commits/4.0
|
m = max_commits/4.0
|
||||||
|
if m == 0: return 1
|
||||||
m = math.ceil(m)
|
m = math.ceil(m)
|
||||||
m = int(m)
|
m = int(m)
|
||||||
return m
|
return m
|
||||||
@ -112,7 +123,6 @@ def get_start_date():
|
|||||||
date = datetime.datetime(d.year-1, d.month, d.day, 12)
|
date = datetime.datetime(d.year-1, d.month, d.day, 12)
|
||||||
weekday = datetime.datetime.weekday(date)
|
weekday = datetime.datetime.weekday(date)
|
||||||
while weekday < 6:
|
while weekday < 6:
|
||||||
print repr(date)
|
|
||||||
date = date + datetime.timedelta(1)
|
date = date + datetime.timedelta(1)
|
||||||
weekday = datetime.datetime.weekday(date)
|
weekday = datetime.datetime.weekday(date)
|
||||||
return date
|
return date
|
||||||
@ -137,12 +147,14 @@ def commit(content, commitdate):
|
|||||||
def fake_it(image, start_date, username, repo, offset=0, multiplier=1):
|
def fake_it(image, start_date, username, repo, offset=0, multiplier=1):
|
||||||
template = ('#!/bin/bash\n'
|
template = ('#!/bin/bash\n'
|
||||||
'REPO=%s\n'
|
'REPO=%s\n'
|
||||||
'git init $"REPO"\n'
|
'git init $REPO\n'
|
||||||
'cd $"REPO"\n'
|
'cd $REPO\n'
|
||||||
|
'touch README.md\n'
|
||||||
|
'git add README.md\n'
|
||||||
'touch gitfiti\n'
|
'touch gitfiti\n'
|
||||||
'git add gitfiti\n'
|
'git add gitfiti\n'
|
||||||
'%s\n'
|
'%s\n'
|
||||||
'git remote add origin git@github.com:%s/$"REPO".git\n'
|
'git remote add origin git@github.com:%s/$REPO.git\n'
|
||||||
'git pull\n'
|
'git pull\n'
|
||||||
'git push -u origin master\n')
|
'git push -u origin master\n')
|
||||||
strings = []
|
strings = []
|
||||||
@ -189,8 +201,7 @@ def main():
|
|||||||
|
|
||||||
output = fake_it(image, get_start_date(), username, repo, offset, m)
|
output = fake_it(image, get_start_date(), username, repo, offset, m)
|
||||||
save(output, 'gitfiti.sh')
|
save(output, 'gitfiti.sh')
|
||||||
print 'gitfiti.sh saved. Create a new(!) repo at: https://github.com/new\
|
print 'gitfiti.sh saved. Create a new(!) repo at: https://github.com/new and run it.'
|
||||||
run it from inside the repo you want to gitfiti'
|
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
main()
|
main()
|
BIN
pixels-large.png
Normal file
BIN
pixels-large.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 858 B |
BIN
pixels.png
BIN
pixels.png
Binary file not shown.
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 484 B |
Reference in New Issue
Block a user