What is the Law of Demeter?

At work, we’re running through The Pragmatic Programmer - the original, not the 2nd edition published last year. If anyone is reading that, I’d love to know if it really updates things for modern programming and whether it seems necessary. The original seems pretty timeless. Yesterday was my turn to present, listing out highlights from chapter 5, sharing some thoughts, and hopefully spurring some conversation. The authors start by talking about the Law of Demeter, but they don’t explain it very well, nor do they call it by its much more self-explanatory name, the Principle of Least Knowledge. ...

  May 2, 2020 (rev. Sep 16, 2025) ·  6 min

How to find the iCal address for a public Google calendar

Every Google calendar URL has an iCal file you can use… here’s how to find it.

  Feb 28, 2020 (rev. Sep 16, 2025) ·  2 min

How to make a dark mode with CSS

Every time I learn some new piece of CSS I’m amazed at how flexible and powerful it is. Like how easy it is to tailor your site for your visitor’s “dark mode” preference!

  Feb 13, 2020 (rev. Sep 16, 2025) ·  3 min

Deploy your own RequestBin in under 5 minutes

If you need to consume a webhook from another service, or verify the payload being sent from your own REST API endpoint, RequestBin can help. It intercepts and displays the contents of any call made to it. Here’s how to deploy your own instance in just a few minutes.

  Jan 5, 2020 (rev. Sep 16, 2025) ·  4 min

Hands-on Ansible, using two DigitalOcean Ubuntu droplets

Today I’m wrapping my head around a build tool called Ansible, used for deploying machines in a scriptable, repeatable manner. Follow along as I step through an excellent tutorial from DigitalOcean, applying what I learn to a couple DO Ubuntu VMs… the $5/mo ones - nothing fancy needed!

  Dec 18, 2019 (rev. Sep 16, 2025) ·  4 min

Add and subtract time from a DateTime structure in Erlang

I was trying to add times in Erlang, but couldn’t find an existing function, so I wrote my own.

  Dec 1, 2019 (rev. Sep 16, 2025) ·  2 min

Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

This error might look a little cryptic at first glance, but it’s fairly descriptive in explaining what’s wrong. You’re likely to come across this one before your first cup of coffee.

  Nov 14, 2019 (rev. Sep 16, 2025) ·  2 min

Assign C# code to a variable and then run it

Did you know most languages have a way to pass around code to other functions, so you can call (invoke) it in other parts of your application? In C#, it’s called a delegate.

  Nov 13, 2019 (rev. Sep 16, 2025) ·  3 min

How can I find the state of NumLock, CapsLock or ScrollLock in WPF?

If you’re writing a WPF application and need to find the state of the Num Lock, Caps Lock, or Scroll Lock keys, you’re in luck - there’s a method for that.

  Nov 12, 2019 (rev. Sep 16, 2025) ·  1 min

What is the opposite of Any in LINQ?

One of the many nice functions in LINQ is a single word that iterates through a collection, returning true if at least one item in the collection matches the condition you specify. But what’s the opposite of the Any keyword in LINQ?

  Nov 11, 2019 (rev. Sep 16, 2025) ·  2 min