Convert Figma logo to code with AI

gelstudios logogitfiti

abusing github commit history for the lulz

8,030
1,117
8,030
22

Quick Overview

Gitfiti is a Python script that allows users to create custom commit patterns on their GitHub contribution graph. It generates a series of commits that, when viewed on GitHub, form pixel art or text designs on the user's contribution history.

Pros

  • Allows for creative and unique customization of GitHub profiles
  • Provides a fun way to engage with version control and GitHub
  • Includes pre-made templates for easy use
  • Can be used to draw attention to a GitHub profile or project

Cons

  • May be considered as gaming the GitHub contribution system
  • Could potentially be seen as unprofessional in certain contexts
  • Requires creating a new repository or using an existing one for the commit pattern
  • The created commits don't represent actual coding contributions

Code Examples

  1. Creating a custom pattern:
giti = [[1,1,1,1,1,1,1],
        [1,0,0,0,0,0,1],
        [1,0,1,1,1,0,1],
        [1,0,1,0,1,0,1],
        [1,0,1,1,1,0,1],
        [1,0,0,0,0,0,1],
        [1,1,1,1,1,1,1]]
  1. Generating commits for the pattern:
for y, row in enumerate(giti):
    for x, cell in enumerate(row):
        if cell:
            date = datetime(2023, 1, 1) + timedelta(days=y*7 + x)
            for _ in range(cell):
                os.system(f'GIT_AUTHOR_DATE="{date}" GIT_COMMITTER_DATE="{date}" git commit --allow-empty -m "gitfiti" > /dev/null')
  1. Running the script:
if __name__ == '__main__':
    gitfiti = Gitfiti()
    gitfiti.run()

Getting Started

  1. Clone the repository:

    git clone https://github.com/gelstudios/gitfiti.git
    
  2. Navigate to the project directory:

    cd gitfiti
    
  3. Run the script:

    python3 gitfiti.py
    
  4. Follow the prompts to select a pattern or create your own.

  5. Push the generated commits to your GitHub repository:

    git push origin master
    

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Build Status

gitfiti noun : Carefully crafted graffiti in a github commit history calendar.

An example of gitfiti in the wild:
screenshot of gitfiti

gitfiti.py is a tool to decorate your github account's commit history calendar by (blatantly) abusing git's ability to accept commits in the past.

How? gitfiti.py generates a script (powershell or bash) that makes commits with the GIT_AUTHOR_DATE and GIT_COMMITTER_DATE environment variables set for each targeted pixel.

Since this is likely to clobber repo's history, it is highly recommend that you create a new github repo when using gitfiti. Also, the generated script assumes you are using public-key authentication with git.

Pixel Art

pixel art examples
Included "art" from left to right: kitty, oneup, oneup2, hackerschool, octocat, octocat2

Usage

  1. Create a new github repo to store your handiwork.
  2. Run gitfiti.py and follow the prompts for username, art selection, offset, and repo name.
  3. Run the generated gitfiti.sh or gitfiti.ps1 from your home directory (or any non-git tracked dir) and watch it go to work.
  4. Wait... Seriously, you'll probably need to wait a day or two for the gitfiti to show in your commit graph.

User Templates

The file format for personal templates is the following:

  1. Each template starts off with a ":" and then a name (eg. ":foo")
  2. Each line after that is part of a json-recognizable array.
  3. The array contain values 0-4, 0 being blank and 4 being dark green.
  4. To add multiple templates, just add another name tag as described in 1.

For example:

:center-blank
[[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,0,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1]]

This would output a 7 x 7 light green square with a single blank center square.

Once you have a file with templates, enter its name when prompted and the templates will be added to the list of options.

Removal

Fortunately if you regret your gitfiti in the morning, removing it is fairly easy: delete the repo you created for your gitfiti (and wait).

License

gitfiti is released under The MIT license (MIT)


Todo

Notable derivatives or mentions