Weekly review cw 50
A one-character bug fix kept me on my toes for the week and showed that sometimes the will to learn from mistakes has to be ironclad.
One-character bug fix
Even days later, a bug fix from this week just makes me shake my head. The fix consisted of one character. To be precise, I had to remove a character. Namely the g
at the end of a regular expression. I learned from this mistake that regular expressions with a /g
at the end are not only global but stateful. I.e., when I test a string with this regular expression, JavaScript saves a state. The result is that if I test the same string against the expression twice, it will be "true" in the first call and "false" in the second call. This fact led to unpleasant side effects in my tests, which I initially observed with total perplexity. I love learning, but this was a frustrating and painful process.
Book review "Everything is hard before it is easy"
I mostly read this book on the go on the train, in waiting rooms, or on the wooden bench in the sports hall. I didn't write out the relevant parts in my bullet journal as usual, but I highlighted them with a highlighter. Accordingly, as a first step for my book review, I had to browse through the entire book and write down my thoughts afterward, to then write the actual book review in the second step. This went surprisingly well, even though I prefer writing down my thoughts directly on exciting passages. I imagine this will make me even more aware of the issue. Writing the notes forces me to delve deeper into the topic as I read them.
Lighthouse Test by YADL
I carried out the Lighthouse test for this blog and discovered some potential for optimization. One point was to optimize the images - for this, I used a Kirby plug-in that converts and scales hero images and images in the body text into WebP format. This caused the note page to shrink from 30 MB to 2 MB. Additionally, I could simply insert a loading="lazy"
for images outside the initial visible area. When I remember what effort it once took with JavaScript to achieve the same functionality - the browser evolution is remarkable.
Docker-Compose Dev Setup with SSL
For my new project, the development environment, hosted on a Hetzner server, should be equipped with SSL. We start up the services with Docker-Compose. Accordingly, I wanted to "briefly" install a web server in docker-compose.yaml and deliver the Lets Encrypt certificate for SSL. A few hours passed before everything was up and running. I'm always amazed at how seemingly simple and everyday things in IT can eat up a disproportionate amount of time.
Table tennis Christmas party for the youth
With the end of the year comes the time of Christmas celebrations, likewise for the table tennis youth at NTSV. I organized a Christmas party in the form of a tournament with my son – the youth director. The mixture of fun (extremely healthy snack buffet) and competition with prizes delights children and young people. It's always a pleasure to see the children having a lot of fun.
One downside remains - broken material is to be expected, but no notice is given. I have to give the children a better feeling of security so that they have the courage to tell. I'll tackle that in the new year.