I have been working with dense tree structures recently, and rendering them using React. Trees lend themselves well to recursion, so I set about making a component that could render itself and all subsequent children with ease. I thought I was being mightily clever, until I tried to add some behaviour to my recursive component. Read on →

Javascript decorators are a form of metaprogramming: they add functionality to classes and properties. Unlike the GoF pattern, where decorators modify instances of a class, Javascript decorators are run when the class, method, or property is installed, modifying all instances.

Decorators are useful for adding extra functionality to behaviours and properties that would otherwise look like boilerplate — such as cacheing, access control, logging, or instrumentation. Read on →

I recently discovered some new (to me) features of enums, and so naturally I am now using them for everything. One of these new-to-me features is using a constructor to give enum members properties and behaviour. Read on →

Some companies don’t allow their employees to use social media at work, and some countries don’t allow their citizens to access news outside of controlled outlets. How do these institutions control access to information that seems so available in other contexts? Through iptables. Read on →