I played two games recently: Death’s Door and The Forgotten City, both on the Playstation 5. Both were good (Death’s Door I’d even say great), but one thing they have in common that I don’t love about modern video games is the notion that the story is over, but wait, there’s more! More quests, or endings, or collectibles, or twists on playing the game you just played but slightly differently.
I kind of liked old video games where there was an end, and you could say you beat it, or, more likely with some Nintendo-hard games, didn’t.Permalink
In January of 2020 we bought a new car, a 2019 Volkswagen GTI. It’s become a little touchpoint on the pandemic over the years.
We bought the car because, while we had gotten by with only one car for a few years at that point, Andrea had started a new job that required one, and while I was already mostly remote, various kid related tasks were outside the range of convenience for seriously considering walking.
Volkswagen sets its service schedule as 10,000 miles or 1 year. If it had been used to commute every day, plus various side trips, it probably would have been around that mileage mark. Instead, after having it for 2 months, we found out we wouldn’t be commuting for a while, which became a long while, which by January was looking pretty much like never, ever again. It had under 3,000 miles on it. I waited at the dealership for the service because at that point it was a bit of a novelty to be out in public. It was still pre-vaccine so everyone waiting was avoiding the other people waiting, and most of the people working at the dealership were over it. They had a VW Bug by the front door. I went to Trader Joe’s on the way home, and there was a queue out front to limit the number of people in the store at any time. A cheerful Trader Joe’s employee handed you a cart when they let you in.
2 years, or 20,000 miles. We’re still well under 10,000 miles despite using the GTI for every “trip” we’ve taken in the last two years. They replaced the VW Bug in the lobby with a VW Bus. Everyone is, once again, wearing masks, but it doesn’t feel weird to drink coffee while waiting, or have a conversation at a reasonable, human distance. There’s a 2022 GTI in the dealership in the flat-gray color I wanted to get ours in1, but two years later I wouldn’t even think about a new gas powered car. We’ll drive the two we have until they become dinosaurs running on dinosaurs. I went to Trader Joe’s on the way home. There was no queue outside, but the store was its normal weekend levels of packed. I had to get my own cart.
What’s my best guess for January, 2023? No masks. Finally hit 10,000 miles but still well under 20,000 and impossibly far from 30,000. I’ll still go to Trader Joe’s after. I’ll be smart enough to do this on a weekday so I don’t get stuck in the weekend crowd. Things change, but things stay the same.
This blog post is based off this tweet reply. Because I read it and thought “oh, I already did write about this!” then tried searching for it on the site and couldn’t find it by clicking around, so I searched in the files for the site on my computer and couldn’t find it, then searched across my entire computer and found a long blog post about using Lunr to search gifs that I never finished1.
So, here’s a finished version in a similar vein: let’s add search functionality to this site using Lunr. We need to build an index for Lunr at build time, which means we need some piece of code that will be triggered to begin looking for items to add. I did this by creating a new Search page (/search). I copied the logic from my index page and removed some logic that isn’t relevant, but the code here gets all of the markdown files in my content folder and then loops through them. In this case we want to build a “document” structure for Lunr to be able to search through:
In the actual Search page component itself, we build the Lunr index from the
After this we wire up the Search page to have a text input that, on change, searches the Lunr index. This is the code for the entire page2:
So that’s cool, and it works, but one thing I noticed here is that this Lunr search runs against the full text of the content, but once you click through, if the post is long it’s not immediately obvious where the term you were searching for appears. Let’s do something about that, at least for blog content.
First, let’s append a query parameter to the link we get from our search results, like this:
This blog is built with Next so for me getting that query parameter on any given page looks something like:
All of the post content is written in Markdown, so we can pass the post body to a function that looks for the search term in the string and replaces it, like this:
One thing I realized was doing it this way breaks links that might have the search term in it, because the searching is happening on the unprocessed Markdown. Running it post processing would be better, but to be lazy, let’s just search for the word with a reasonable set of boundaries to ignore, like this:
which eliminates most slugified versions of the word. It’s still case sensitive but the 80/20 among its users (me) says it’s good enough to ship.
Check it out
That means that I should just marshal some self-control and just tone down the usage of these apps with nothing but my will, right?! Wroooong! We’re gonna make the technology do it for us!
I said in my last weeknotes post I didn’t want to do weeknotes any more, so this isn’t that, it’s just a post that happens to be on a Sunday that maybe talks about the past week.
NFTs are the human capacity for visual expression as understood by the guy at the vape store. There is the predominance of skulls. There is the melodramatic deployment of the visual language of video games, as if romanticism had been invented by people who never went outside.
via Robin RendleCheck it out