Advent of Code - Day 5

Another easy day for Advent of Code. The first challenge was to simply iterate over a string (take an input string, add 1 to it, and increase that number), make a hash, and check to see if the hash begins with 5 zeroes. If it does, you take the number after the 5 zeroes as a password character. You keep appending to a password until you have seven characters: var crypto = require('crypto'); var input = 'ojvtpuvg'; generatePassword(input); function generatePassword(s) { console.

Read more

Advent of Code - Day 3 and 4

Only 5 days into Advent of Code and already this thing is kicking my rear. Both challenges over the weekend were (mostly) simply, but I’m already having trouble keeping up. This is a good thing though. I’m still absolutely loving the hell out of these challenges! Day 3 Day 3 was a rather simple problem. Given three numbers, can you determine if they could be a triangle? Turns out there’s a simple mathematical formula for that - any two side lengths must add to a number larger than the third side.

Read more

Advent of Code - Day 2

The second day’s challenge for Advent of Code was a bit easier than the first, so it was nice to tackle it a bit quicker. The puzzle involves a set of directions for moving your fingers over a numeric keypad. Imagine a typical security keypad layed out like so: 1 2 3 4 5 6 7 8 9 Then take input in this form: LLRUDD UUD Each line represents a set of movements to the left, right, up, and down.

Read more

Begin the Advent of Code!

Forgive the somewhat dramatic title, but today begins one of the coolest coding challenges I’ve ever done, the Advent of Code. The Advent of Code presents you with two coding challenges a day. (The second is typically a minor modification of the first one.) You can solve the challenge anyway you want. They start off - mostly - kind of simple and then kind of go off the deep end towards the end.

Read more

A Simple Stats Script for Hugo

I’m somewhat obsessed with stats, and one of the things I look at is my rate of publishing overtime. I’ve run this blog since 2003 and have gone from blogging 30+ times a month to - well - somewhat less than that. Quality is - of course - far more important than quantity. But as a general stat, I just like to know how much I’m writing. My static site generator of choice, Hugo, doesn’t have anything built in to support getting this.

Read more

Scraping a web page in Node with Cheerio

In yet another example of “I will build the most stupid crap ever if bored”, this week I worked on a Node script for the sole purpose of gathering data about SiriusXM. I’m a huge fan of the radio service (mostly because 99% of my local radio stations are absolute garbage, except for KRZS), and I was curious if the service had an API of some sorts. I was not able to find one, but I did find this page:

Read more

Online Pug Testing Tool

I’ve never been shy about my feelings about the Jade templating language. I absolutely hate it. I think it is weird. I think it leads to moral depravity. I just really, really don’t like it. Mainly I think because I find HTML already succinct enough. I mean I get that this: h1 Foo is less code than <h1>Foo</h1> but my brain just has issues mapping the Jade version to the output.

Read more

November is National Adoption Month

Every year (sometimes sooner than later), I remind folks that November is national Adoption Month. My wife and I have been blessed to have formed our family via international adoption. We have three kids adopted from South Korea and three from China. It is an incredible process. Beautiful, scary, difficult, rewarding, a mix of everything you would expect in bringing a new life into your family. If you’ve never considered adoption before, then now is a perfect time to start thinking about it.

Read more