<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jason Lee</title>
    <description>The latest articles on DEV Community by Jason Lee (@diwnsgml).</description>
    <link>https://dev.to/diwnsgml</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271040%2Fc399c01e-6f3c-412c-a94d-ac4e8fcab27b.jpg</url>
      <title>DEV Community: Jason Lee</title>
      <link>https://dev.to/diwnsgml</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/diwnsgml"/>
    <language>en</language>
    <item>
      <title>I turned GitHub contribution graphs into Christmas lights (one line in your README)</title>
      <dc:creator>Jason Lee</dc:creator>
      <pubDate>Sat, 28 Nov 2026 16:27:49 +0000</pubDate>
      <link>https://dev.to/diwnsgml/i-turned-github-contribution-graphs-into-christmas-lights-one-line-in-your-readme-54on</link>
      <guid>https://dev.to/diwnsgml/i-turned-github-contribution-graphs-into-christmas-lights-one-line-in-your-readme-54on</guid>
      <description>&lt;p&gt;Every December people redecorate their profile READMEs. I wanted mine to twinkle.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Commit Lights&lt;/strong&gt;. Type a GitHub username and your last year of contributions becomes one string of Christmas lights. Busy days glow white-hot, empty days stay dim. Copy one line into your profile README and it twinkles there all month.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ttllerpyubz6wupi8t8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ttllerpyubz6wupi8t8.gif" alt="A made-up sample year of contributions drawn as a string of Christmas lights" width="720" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;That's a made-up sample year, not a real person.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://commitlights.e5d.workers.dev/?utm_source=devto&amp;amp;utm_medium=ours&amp;amp;utm_campaign=launch" rel="noopener noreferrer"&gt;https://commitlights.e5d.workers.dev/?utm_source=devto&amp;amp;utm_medium=ours&amp;amp;utm_campaign=launch&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add it in 30 seconds
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the link, type your username, press &lt;strong&gt;Light it up&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Copy README snippet&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste it into the README of the repo named exactly like your username (that's your profile README) and commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The line looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;[![@USER's contributions as Christmas lights](https://commitlights.e5d.workers.dev/api/lights/USER.svg)](https://commitlights.e5d.workers.dev/?u=USER&amp;amp;utm_source=readme&amp;amp;utm_medium=embed&amp;amp;utm_campaign=s1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No profile README yet? Create a public repo named exactly your username and tick "Add a README".&lt;/p&gt;

&lt;h2&gt;
  
  
  Make it yours
&lt;/h2&gt;

&lt;p&gt;On the result screen, under &lt;strong&gt;Twinkle&lt;/strong&gt;, pick &lt;strong&gt;Gentle&lt;/strong&gt;, &lt;strong&gt;Medium&lt;/strong&gt; (the default), &lt;strong&gt;Lively&lt;/strong&gt; or &lt;strong&gt;Off&lt;/strong&gt;. The preview changes, and the line you copy follows your pick.&lt;/p&gt;

&lt;p&gt;Already pasted it? Change the image URL, the part that ends in &lt;code&gt;.svg&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://commitlights.e5d.workers.dev/api/lights/USER.svg                  medium, the default
https://commitlights.e5d.workers.dev/api/lights/USER.svg?twinkle=gentle   calmer: only the lit bulbs move
https://commitlights.e5d.workers.dev/api/lights/USER.svg?twinkle=lively   every bulb blinks, faster
https://commitlights.e5d.workers.dev/api/lights/USER.svg?motion=0         still lights, no animation code at all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the URL already has a &lt;code&gt;?&lt;/code&gt; in it (the theme-matched version has &lt;code&gt;?theme=dark&lt;/code&gt; and &lt;code&gt;?theme=light&lt;/code&gt;), add &lt;code&gt;&amp;amp;twinkle=gentle&lt;/code&gt; or &lt;code&gt;&amp;amp;motion=0&lt;/code&gt; to both URLs instead.&lt;/p&gt;

&lt;p&gt;See the three levels on the sample year: &lt;a href="https://commitlights.e5d.workers.dev/api/lights/_sample.svg?twinkle=gentle&amp;amp;utm_source=devto&amp;amp;utm_medium=ours&amp;amp;utm_campaign=launch" rel="noopener noreferrer"&gt;gentle&lt;/a&gt;, &lt;a href="https://commitlights.e5d.workers.dev/api/lights/_sample.svg?utm_source=devto&amp;amp;utm_medium=ours&amp;amp;utm_campaign=launch" rel="noopener noreferrer"&gt;medium&lt;/a&gt;, &lt;a href="https://commitlights.e5d.workers.dev/api/lights/_sample.svg?twinkle=lively&amp;amp;utm_source=devto&amp;amp;utm_medium=ours&amp;amp;utm_campaign=launch" rel="noopener noreferrer"&gt;lively&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The data.&lt;/strong&gt; The server asks GitHub's GraphQL API for one thing, your public contribution calendar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; $&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;contributionsCollection&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;contributionCalendar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;totalContributions&lt;/span&gt;
        &lt;span class="n"&gt;weeks&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;contributionDays&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="n"&gt;contributionCount&lt;/span&gt; &lt;span class="n"&gt;contributionLevel&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;contributionLevel&lt;/code&gt; is GitHub's own 5-step bucket (&lt;code&gt;NONE&lt;/code&gt; up to &lt;code&gt;FOURTH_QUARTILE&lt;/code&gt;), so the lights match your graph square for square. You never sign in or hand over a token. The server uses one read-only token of mine, and it never scrapes GitHub's HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The SVG.&lt;/strong&gt; The 7×53 grid becomes one wire. Sunday's row runs left to right, loops down, Monday's row runs back, and so on, ending in a little plug. The wire sags a bit between months. Each day is a C9-style bulb: level 0 is unlit glass, level 4 is near-white with a halo. Every bulb is a &lt;code&gt;&amp;lt;use&amp;gt;&lt;/code&gt; of a few shared symbols in &lt;code&gt;&amp;lt;defs&amp;gt;&lt;/code&gt;, which keeps the file well under 80 KB. There are no scripts, no external refs and no web fonts (an SVG loaded as an image can't fetch fonts anyway), so the labels use the system font stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The twinkle.&lt;/strong&gt; It's pure CSS inside the SVG, and it only changes opacity. At the default level each lit bulb dims and comes back on its own 2.2 to 3.8 second cycle, its halo sparkles as it returns, and about one in three dark bulbs glows faintly. The bulbs are dealt into 24 timing classes that run in opposite phases, so while some fade out others fade in, and the brightness of the whole picture stays flat. Nothing pulses in sync. An earlier version only dimmed the lit bulbs slowly, and at phone width it read as a still picture: on my graph, about 4% of the image changed every 0.7 seconds. The default now changes about 16%. A one-time 1.2s sweep plugs the string in from left to right. &lt;code&gt;prefers-reduced-motion&lt;/code&gt; turns it off, and &lt;code&gt;?motion=0&lt;/code&gt; serves a version with no animation at all. Frame zero is the finished picture, so anything that strips CSS animation still shows the whole string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caching, and camo.&lt;/strong&gt; GitHub doesn't load README images from my server directly. It proxies them through camo (&lt;code&gt;camo.githubusercontent.com&lt;/code&gt;), which caches them. So the SVG sends &lt;code&gt;Cache-Control: max-age=14400&lt;/code&gt; (4 hours) with an ETag, and answers 304 when nothing changed. Behind that, each calendar is cached for 12 hours, and a stale copy is served while it refreshes. If GitHub is slow or I hit a rate limit, you get your last known lights, or a sample string that says "warming up". Never a broken image. A contribution graph changes once a day, so a few hours of lag is fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The link wrap.&lt;/strong&gt; A README image isn't clickable unless you wrap it in a link. This snippet comes wrapped, so someone who sees your lights can tap them and make their own. That's also how a project like this gets found, and I'd rather say so plainly. The link has UTM tags so I can count visits that come from READMEs. I don't store IPs, and I never tie a visit to a GitHub username.&lt;/p&gt;

&lt;p&gt;It all runs on Cloudflare Workers' free tier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Credit
&lt;/h2&gt;

&lt;p&gt;Decorating the contribution graph isn't my idea. &lt;a href="https://github.com/Platane/snk" rel="noopener noreferrer"&gt;Platane/snk&lt;/a&gt;, the snake that eats your graph, did it first and did it well. This is the December version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Mine is on my own profile, dark stretches included. I'm not making filler commits to brighten it. The quiet weeks were real, and they stay dim.&lt;/li&gt;
&lt;li&gt;I build one small app every 5 days, in public. This is #3. Most don't work out, and I post the numbers either way.&lt;/li&gt;
&lt;li&gt;Not affiliated with GitHub. Remove it any time by deleting the line. To stop it serving your username at all, open an issue titled "opt-out" on the repo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/dIwnsgml/commit-lights" rel="noopener noreferrer"&gt;https://github.com/dIwnsgml/commit-lights&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you add it, I'd love to see it: drop your profile link in the comments.&lt;/p&gt;

&lt;p&gt;What would you change? I'm especially curious whether it animates for you on mobile.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: an AI agent drafted this post for me and published it from my account; the technical details were checked against the code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>github</category>
      <category>css</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
