Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
gelstudios committed May 2, 2013
1 parent f7614ab commit 1456cee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
gitfiti _noun_ : carefully crafted graffiti in a github commit history calendar.

<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;"/>
<img src='https://raw.github.com/gelstudios/gitfiti/master/pixels-large.png' alt='gitfiti art'/>

`gitfiti.py` is a tool I wrote to decorate your github account's commit history calendar by (blatantly) abusing git.

Expand All @@ -25,8 +23,4 @@ Fortunately if you regret your gitfiti in the morning, removing it is fairly eas
- ...
- Profit?





![alt text](http://f.cl.ly/items/0J463J0K1N020S1Q3E3l/er-small.png "tiny logo")
23 changes: 17 additions & 6 deletions gitfiti.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
[0,0,0,3,4,4,4,4,3,0,0,0]]

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,4,2,2,1,1,1,2,2,4,0],
[4,3,2,2,1,1,1,2,2,3,4],
Expand Down Expand Up @@ -75,6 +84,7 @@
images={
'kitty':kitty,
'oneup':oneup,
'oneup2':oneup2,
'hackerschool':hackerschool,
'octocat':octocat,
'octocat2':octocat2,
Expand Down Expand Up @@ -102,6 +112,7 @@ def max_commits(input):
def multiplier(max_commits):
"""calculates a multiplier to scale github colors to commit history"""
m = max_commits/4.0
if m == 0: return 1
m = math.ceil(m)
m = int(m)
return m
Expand All @@ -112,7 +123,6 @@ def get_start_date():
date = datetime.datetime(d.year-1, d.month, d.day, 12)
weekday = datetime.datetime.weekday(date)
while weekday < 6:
print repr(date)
date = date + datetime.timedelta(1)
weekday = datetime.datetime.weekday(date)
return date
Expand All @@ -137,12 +147,14 @@ def commit(content, commitdate):
def fake_it(image, start_date, username, repo, offset=0, multiplier=1):
template = ('#!/bin/bash\n'
'REPO=%s\n'
'git init $"REPO"\n'
'cd $"REPO"\n'
'git init $REPO\n'
'cd $REPO\n'
'touch README.md\n'
'git add README.md\n'
'touch gitfiti\n'
'git add gitfiti\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 push -u origin master\n')
strings = []
Expand Down Expand Up @@ -189,8 +201,7 @@ def main():

output = fake_it(image, get_start_date(), username, repo, offset, m)
save(output, 'gitfiti.sh')
print 'gitfiti.sh saved. Create a new(!) repo at: https://github.com/new\
run it from inside the repo you want to gitfiti'
print 'gitfiti.sh saved. Create a new(!) repo at: https://github.com/new and run it.'

if __name__=='__main__':
main()
Binary file added pixels-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pixels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1456cee

Please sign in to comment.