A short recap of Advent of Code 2020
Writing about my experiences with Advent of Code has become something of a yearly tradition for me, and while 2020’s entry has lapsed into 2021, I am here to continue the tradition all the same! In a year otherwise marred by difficulties for so many people on so many fronts, it was nice to have the distraction of programming puzzles for an hour or so each December evening. My only goal this year (in addition to completing all the puzzles) was to try and leverage some of the new C# 9.0 functionality such as record types. These were useful but haven’t quite made it into my “muscle memory” yet, so it’s hard to reach for new features when you’re racing against the clock. ...
Yatzy with boardgame.io
Two years ago I wrote about creating a simple Four In A Row game with boardgame.io. It continues to get some traffic, despite being somewhat outdated due to continued improvements to the boardgame.io framework. As such, I thought it would be a good time to revisit the framework again with a new game, Yatzy. At a minimum I will make the following improvements over my previous game: Build a more complicated rules engine with multiple moves and dynamic scoring Use the latest boardgame.io framework available (0.35.1, at the time of writing) Support a variable number of players (1-4) Introduce an element of randomness (rolling dice) Cleaner UI with Bootstrap 4 Use TypeScript Over time I may add additional features or leverage more framework features, if there is any interest. ...
Wrapping up Advent of Code 2019
Another year, another Advent of Code event completed! I’ve blogged before about participating in the 2018 event and catching up on the 2015, 2016 and 2017 events, so I thought I would keep the tradition going by sharing my experience with the 2019 event that has recently finished. This blog assumes a certain level of familiarity with Advent of Code - if you don’t know what it is, check out the website or one of my previous blog posts. ...
Catching Up on Advent of Code
Earlier this year I posted about my experience participating in Advent of Code 2018. For those who aren’t familiar, Advent of Code is (to quote the website): an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. On each December day leading up to Christmas all players are presented with an identical puzzle that requires programming to solve. Puzzles have two parts, the second of which is only provided after successfully completing the first. The second part compliments the first in a variety of ways, such as extending the program to deal with additional scenarios or by altering the input in a way that tests the performance limits of the code. ...
Thoughts on Advent of Code 2018
I recently participated in Advent of Code 2018. Overall it was a very positive experience and I thought I would share some thoughts about the whole thing (albeit a lot later than intended!). I learnt about Advent of Code less than 24 hours before the 2018 event (the fourth of its kind) began, after it was shared with me by a friend who has participated in previous years. My first thought was of other programming challenges such as Project Euler and Kattis, both of which I’ve trialled briefly in the past. After reading some of the puzzles from previous years I was also reminded of the “problem solving competitions” I participated in back in my school days - simple questions that tested basic logic, mathematics and reading comprehension. A such I was instantly hooked - not just for the puzzles themselves, but also the promise of a month long commitment that would allow me to procrastinate on all the things I should have been doing to finish the year! ...
Four In A Row with boardgame.io
Google recently released a “not an official Google product” framework called boardgame.io. To quote the documentation: The goal of this framework is to allow a game author to essentially translate the rules of a game into a series of simple functions that describe how the game state changes when a particular move is made, and the framework takes care of the rest. You will not need to write any networking or backend code. ...
Revisiting a Site Built On Azure Functions
Last year I blogged about Building a Small Site on Azure Functions. It was an interesting experiment, though not a serious solution I’d recommend to anyone based on that experience. Still, the site has been running away in the background serving the very occasional visitor since then at the cost of just a few cents per month. At some point in the last month or two (some form of monitoring would have helped here) the site stopped working. Based on a quick search I think this might be due to do some breaking changes in Azure Function Proxies (a preview technology) and its handling of catch-all routes, but I’m not entirely sure. ...
Named Dbup Code Scripts
I’m a big fan of the DbUp library and its approach to database management. Rather than go over all the benefits of this approach, I’ll leave it to the docs which do a much better job than I could. Suffice it to say, all the things it brings to the table - tight control, predictability, ORM independence, the power of raw SQL - are all good things! Historically I have been able to do most things with this raw SQL approach. I’ve created these scripts with a fairly typical (I think) naming convention like so: ...
isitinthe.cloud - Building a Small Site on Azure Functions
I recently stumbled upon Is it on AWS? and its accompanying backstory. It sounded like a fascinating way to create a small, focused website. I thought it would be a positive learning experience to create a similar site with Microsoft Azure. Introducing IsItInThe.Cloud This blog will detail the steps taken to create the site; but first, a few notes: Credit to Is it on AWS? for the initial inspiration. The site is a relatively quick-and-dirty implementation and nowhere near as robust as its source of inspiration. The check is done by a simple IP Address comparison between a site’s DNS lookup and Microsoft’s list of Azure Datacenter IP Ranges . But there are many reasons they may not match, so it should not be considered highly accurate. IPv6 is not currently supported - I wasn’t able to locate any published IPv6 ranges for Azure. Please point me in their direction if you happen to know where to find them! I don’t have a lot of experience with Azure, so I welcome any feedback on any improvements, platform features I haven’t used appropriately, etc. This is probably not a sensible way to host a website - at least not yet anyway - but you be the judge. The source code is available. If you’re unfamiliar (as I am!) with the idea of Serverless Computing, I’d encourage you to start by reading this article by Mike Roberts or the Azure Functions documentation. ...
A Broken Redirect - Why My Certificate Wouldn't Renew
I was recently trying to renew the Let’s Encrypt certificate for this site, but doing so failed with the following error (and an accompanying 404 Not Found): Cert is due for renewal, auto-renewing... Renewing an existing certificate Performing the following challenges: http-01 challenge for lonesomecrowdedweb.com http-01 challenge for www.lonesomecrowdedweb.com Waiting for verification... Cleaning up challenges Attempting to renew cert from /etc/letsencrypt/renewal/lonesomecrowdedweb.com.conf produced an unexpected error: Failed authorization procedure. www.lonesomecrowdedweb.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization Domain: www.lonesomecrowdedweb.com Type: unauthorized Detail: Invalid response from http://www.lonesomecrowdedweb.com/.well-known/acme-challenge/ ... This was because my redirects in NGINX were not configured appropriately, and I didn’t notice due to my use of HTTP Strict-Transport-Security. Correcting the bindings allowed me to renew the certificate successfully. ...