For a while now I've been enamoured with so-called "idle" or "clicker" games. These are games that are (typically) incredibly simple, sometimes having you just click one button over and over again, and typically let you run them in the background, coming back hours later to check your progress. What makes these games interesting is that while they start simpler, as I said, with one button sometimes, they typically grow in complexity as the game goes on.
Happy day! Yesterday I discovered a bug in the script I built to search my blog content (see my last post for details. My search script uses Python to parse my blog content, try to find matches to a list of input terms, and return the result. I noticed that one result, when clicked, led to a 404. Why?
As I've said many times lately, I'm trying to learn Python. I used it for last years Advent of Code and successfully finished ten days of challenges. I'm also on the lookout for other places I can use it, even if just to provide a way to practice the language. Today I looked into making a change to my search interface. It uses Algolia for indexing and searching. Currently it sorts results by the strength of the match, but I was looking for a way to optionally sort by date instead. Algolia supports this via "replicas", a copy of your index. It supports the idea of a "virtual replica" which is the most optimal way of doing it. Unfortunately, this is not supported on their free tier. To be clear, Algolia provides awesome value at their free tier so I don't blame them for charging for this, but I needed a solution of some sort. Enter Python!
Once again I'm posting a "yearly roundup" that mainly serves to let me figure out how I did last year and figure out my plans for next year. I figure no one reads these but me, but I honestly feel like it's useful to take stock and recognize my accomplishments. Plus, it lets me get the first post of the year out the door and that's always a good thing. Oh, and I found a small bug in my blog while writing this, so that's even better. Let's get started!
For the last post of the year (probably, I'm off next week with very little on my calendar so I hope to spend a lot of time doing nothing, not blogging) I thought I'd share a quick Python function. This function is inspired by my favorite Christmas movie, "A Christmas Story". In one of the more pivotal scenes, one character dares another to stick their tongue on a cold pole. You see, one of the characters said their dad stated that sticking their tongue on cold metal would result in the tongue sticking. The other character didn't believe it. As you can imagine, disaster unfolds.
Like a lot of people in tech, I'm a bit of a stats junkie, especially when it comes to my blog. Over the years I've used various tools for stats, primarily Google Analytics. Google Analytics is easy to add to a site, but the reports can sometimes be a bit dense to get into. Because of this, I've actually built my own tools. Here's a few examples:
Ok, so this falls into the category of something probably few people will run into, but since I did, I've got to blog it. If only to save myself when I inevitably forget six months from now. Also, all credit for this solution comes from Netlify support engineer [Hrishikesh Kokate](Hrishikesh Kokate). Alright, so what's the issue?