{"id":15639029,"url":"https://github.com/ethomson/github4life","last_synced_at":"2026-02-02T23:37:47.072Z","repository":{"id":40762712,"uuid":"276060376","full_name":"ethomson/github4life","owner":"ethomson","description":"Using your GitHub Contribution Graph as a four-color Game of Life.","archived":false,"fork":false,"pushed_at":"2023-12-04T16:00:42.000Z","size":301,"stargazers_count":94,"open_issues_count":7,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-25T23:36:19.152Z","etag":null,"topics":["cellular-automata","conways-game-of-life","github","github-contributions"],"latest_commit_sha":null,"homepage":"https://github4life.herokuapp.com/ethomson","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethomson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-30T09:51:36.000Z","updated_at":"2025-06-25T15:51:24.000Z","dependencies_parsed_at":"2023-12-04T17:00:58.478Z","dependency_job_id":null,"html_url":"https://github.com/ethomson/github4life","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ethomson/github4life","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethomson%2Fgithub4life","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethomson%2Fgithub4life/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethomson%2Fgithub4life/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethomson%2Fgithub4life/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethomson","download_url":"https://codeload.github.com/ethomson/github4life/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethomson%2Fgithub4life/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29023752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T22:20:39.141Z","status":"ssl_error","status_checked_at":"2026-02-02T22:20:37.621Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cellular-automata","conways-game-of-life","github","github-contributions"],"created_at":"2024-10-03T11:24:24.944Z","updated_at":"2026-02-02T23:37:47.055Z","avatar_url":"https://github.com/ethomson.png","language":"JavaScript","readme":"# GitHub 4 Life\n\n[![ethomson's contribution graph as a Game of Life](https://github4life.herokuapp.com/ethomson.gif)](https://github4life.herokuapp.com/ethomson)\n\nA Node.js application that takes a user's [GitHub Contribution Graph](https://docs.github.com/en/github/setting-up-and-managing-your-github-profile/viewing-contributions-on-your-profile) as input for a [four-color variant](https://conwaylife.com/ref/mniemiec/color.htm) of [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).\n\nThis game is sent to you as an animated GIF.  Each generation of the game will be sent as a frame in the GIF.\n\nThe game will be played forever.  There is no end to the animated GIF, it will just be sent to you until you close the window or your browser runs out of RAM.\n\nYou can see it at [https://github4life.herokuapp.com/ethomson](https://github4life.herokuapp.com/ethomson).\n\n## The Game\n\n[Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) is a piece of [cellular automata](https://en.wikipedia.org/wiki/Cellular_automaton) that is simple to reason about and program, but leads to interesting and sometimes surprising results.  Because of its simplicity in how the cells change throughout generations, it is often an early program written by those learning software development.\n\nThe original Game of Life supports two states for cells - alive or not - but there are [multi-color variants](https://conwaylife.com/ref/mniemiec/color.htm).  In particular, a four-color variant suits the GitHub Contribution Graph nicely, since it has four levels of \"intensity\" of contributions on given days.  The GitHub Contribution Graph could therefore be used as the starting condition for a four-color game of life.\n\nHowever, \"Quad Life\", as described, uses the same algorithm for determining cell state as the original Game of Life.  This is imperfect for us: a contribution graph with a lot of work is not actually a satisfying game - when there are many filled blocks (live cells), there is rampant overpopulation in the game, and the next generation will basically be an empty board due to a mass die-off.\n\nSo this uses a modification to the typical rules: instead of a cell dying immediately, it will \"decay\".  So a cell at intensity 4 becomes a cell at intensity 3.  This produces a more visually interesting game when starting with a heavily loaded contribution graph.\n\n## The GIF\n\nAnimated GIFs are fun because you send the first frame... then the next... and eventually you send the final frame.  But within the file format, you don't need to prefix it with the number of frames.\n\nSo if you just _keep sending frames_, it turns out that most browsers will just render them forever.  So, we can simply set a delay between frames of `0`, render and send a frame every second, and most browsers will dutifully comply, and just render it as a movie that plays forever, until you close the window, the app serving the movie crashes, or you run out of RAM.\n\n_Unfortunately_, some sites - like GitHub - are a little more clever about this and instead of linking you off-site for images, they'll download them, cache them on their service, and then link you to those.  On GitHub, this is a service called \"camo\", and this shows up when you (for instance) create a link in your `README` to an image.  When viewing the page on `github.com` (the website), you'll actually see an inline image at `githubusercontent.com`.\n\nAs you can imagine, you can't cache a GIF that never ends, so this app has a special \"camo mode\" where it will render a finite GIF that has a bunch of frames and then deliver it as fast as possible (camo also has a 4 second timeout).\n\nThe app will cache these finite camo-friendly GIFs.\n\n## The App\n\nThis is a Node.js application that makes use of two new libraries:\n\n* [contributions](https://github.com/ethomson/contributions) [[npm](https://npmjs.com/contributions)]\n  A library to parse the GitHub Contribution Graph.  It basically screen-scrapes the output from GitHub, parsing the DOM.  So...  a little better than hitting it over the head with regular expressions, but not much.\n* [dat-life](https://github.com/ethomson/dat-life) [[npm](https://npmjs.com/dat-life)]\n  A library to live dat life, or more accurately, to play the Game of Life.  It plays the classic game created by Conway, as well as two- and four-color variants, including the \"decay\" mode variant that we use here.\n\nThese libraries don't actually produce any data, so the [gifencoder](https://github.com/eugeneware/gifencoder) package is used to create GIFs that are sent to browsers.\n\n---\n\nCopyright [Edward Thomson](https://twitter.com/ethomson).  Available under the MIT license.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethomson%2Fgithub4life","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethomson%2Fgithub4life","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethomson%2Fgithub4life/lists"}