gitwtfhub

wtf is snake-and-commits?

dahan8473/snake-and-commits — explained in plain English

Analysis updated 2026-05-18

16PythonAudience · developerLicense

TL;DR

Snake and Commits turns a GitHub profile's contribution graph into an animated Snake game that eats each commit square, rendered as a zero dependency SVG via a scheduled GitHub Action.

Mindmap

mindmap
  root((snake-and-commits))
    What it does
      Animates contribution graph
      Snake eats commit cells
      Pure CSS SVG animation
    Tech stack
      Python
      GitHub Actions
      SVG
      GraphQL API
    Use cases
      Profile README decoration
      Scheduled auto regeneration
      Light and dark themes
    Audience
      GitHub profile owners

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Add an animated Snake game version of your GitHub contribution graph to your profile README.

REASON 2

Automatically regenerate the animated graph on a schedule using a GitHub Actions workflow.

REASON 3

Choose or auto switch between light and dark color themes for the generated graph.

What's in the stack?

PythonGitHub ActionsSVGGraphQL API

How it stacks up

dahan8473/snake-and-commits920linjerry-stack/capital-studioadya84/ha-world-cup-2026
Stars161616
LanguagePythonPythonPython
Setup difficultyeasyeasy
Complexity3/52/5
Audiencedeveloperresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

Wtf does this do

Snake and Commits turns a GitHub profile's contribution graph, the grid of green squares showing how often someone commits code, into an actual playable looking game of Snake. Instead of a plain static image, the snake moves across the grid hunting down each filled in square as if it were food, growing longer with every one it eats, and the whole thing renders as an animated image that GitHub can display directly on a profile page. The snake's movement is not random. It uses a real pathfinding method to find the nearest unvisited commit square, avoids running into its own body, and if it gets boxed in with no reachable square left, it chases its own tail until space opens up again. The head glows brightly and the body fades toward the tail, and a small counter tracks how many commit squares have been eaten so far. Everything is drawn as pure animated SVG using CSS only, with no JavaScript, so it displays properly anywhere GitHub renders an image, and it also respects a user's reduced motion accessibility setting by falling back to a plain static graph. Setting it up does not require installing anything locally. A user adds a small GitHub Actions workflow file to their profile repository, the special repository named after their own username that GitHub shows at the top of a profile page. That workflow runs on a schedule, regenerates the snake image from the user's live contribution data, and publishes it, after which the user adds one line of markdown to their profile README pointing at the generated image. Four color themes are available, including a green GitHub style look and a matrix inspired dark theme, and separate light and dark versions can be shown automatically based on the viewer's system settings. The whole tool is a single Python file with no external dependencies beyond the standard library, and it can also be run locally with a GitHub token to generate the image by hand. It is released under the MIT license.

Yoink these prompts

Prompt 1
Explain how breadth first search pathfinding can be used to make a snake automatically hunt the nearest target cell.
Prompt 2
How do I set up a GitHub Actions workflow that runs on a schedule and commits generated files to a separate branch?
Prompt 3
Show me how to animate an SVG grid using only CSS, with no JavaScript, so each cell fades over time.
Prompt 4
How can I query the GitHub GraphQL API to pull a year of contribution graph data for a user?

Frequently asked questions

wtf is snake-and-commits?

Snake and Commits turns a GitHub profile's contribution graph into an animated Snake game that eats each commit square, rendered as a zero dependency SVG via a scheduled GitHub Action.

What language is snake-and-commits written in?

Mainly Python. The stack also includes Python, GitHub Actions, SVG.

Who is snake-and-commits for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.