GitHub Profile

A while ago GitHub released a feature to allow users to customize their profile with a README file.

Although they could have given us a big text field and call it a day, we’ve got a whole repository to play with instead. This means that we can use pictures and custom scripts to showcase our own personalities.

Not surprising then that people soon began to make pretty creative stuff with theirs.

Inspired by them, I decided to try my hand at it. If you want to take a look at it, here’s what I came up with.

Idea

To me, the default profile page is already quite good. It has an avatar, a bio, a list of your repositories. The only thing I miss when looking at someone’s profile is a list of the languages they use.

That’s something I can fix. I can get the languages used from GitHub itself. Not only that, what if I actually show how to get them?

With this in mind, I started working on it.

I found out about asciinema. With it1, I recorded the process of getting and displaying the data from GitHub’s API.

Now I needed some way to display this session in the README file. GitHub is very strict on which HTML tags it allows so I couldn’t go with asciinema’s embedded player.

Images are allowed though, and with svg-term I could render the entire session to an animated SVG. And yeah it ends up being quite heavy, but at least you can zoom in without loss of quality.

Update: I just found out that Chrome isn’t that good at rendering SVGs, so if you want to see it properly I recommend you use firefox.

Self-update

Another problem is that the data I’m querying will change over time, but I don’t want to have to update this manually.

So I prepared a GitHub Action to automate this process. Here’s how it works:

  • It’s triggered either by hand or on a weekly schedule.
  • Sets up Node.js and installs dependencies.
  • Runs a script2 that
    • gets the latest data from GitHub API
    • recreates the SVG file with it
  • Commits the changes

And that’s it! If you didn’t already, you can see this working on my GitHub profile.

Wrapping Up

I’m pretty happy with the result so far.

There’s still a lot to improve. The code isn’t particularly clean and I could probably reduce the number of API calls3.

But I’ve already spent far too much time on this.

  1. Actually I used this unofficial port for powershell instead. 

  2. I could have used powershell like I did in the recording, but given that svg-term uses Node, I went with that instead. 

  3. By using GitHub’s GraphQL API instead of REST. 

Dizzy Art

A while ago, during an attack, I thought to myself that if what Van Gogh had was Meniere’s, then I’d understand why did he cut off his own ear.

Recently I stumbled upon this:

starry night optical illusion

This sparked my curiosity so I decided to do a little search on the topic.

It turns out that some people have already suggested that Van Gogh may have actually suffered from Meniere’s disease, but was misdiagnosed due to it not being well known at the time. Wow.

There’re other theories as well: epilepsy, schizophrenia, depression, drugs, etc. Doctors have been debating over this for ages. But with no way to prove any of them it doesn’t seem like we’ll ever know the truth.

On Air

I’ve been thinking about starting a blog for a while but never tried it before.
This is all new to me. Not only the blog thing, but writing in general.

I spend a lot of time thinking things through. But I’m not used to taking notes. Then all those ideas, which seemed so clear at the moment, start to fade. At the end, I forget most of it.

I want to change that. I want this to be a place where I can write down those thoughts. To understand them better. To clear my mind of clutter. And hopefully gain some insight.

I decided to start a blog for everyone to see instead of, say, keeping a diary. I’m even trying to reach a wider audience by using English1.
My hope is that by having someone at the other end, I will force myself to keep writing. Yeah, like some sort of cheap motivational hack.

It could go the other way. Releasing to the public is scary. And it’s already hard enough to put my thoughts into words in my own language. All this friction may end up working against me.

Time will tell whether this works out or not.

For now, I’m happy to make the first step.

  1. As you can probably tell, not my first language.