22 January 2022

And We're Back

It has been a few years since I published something here. I’ve got a few ideas for things to write about: Kubernetes has happened in a big way since 2016, so that’s something. I passed the CKA exam recently, so hopefully I can write some meaningful articles about what I have learned while building and running K8s clusters for clients and employers. I’ve learned (some) Golang. I wouldn’t call myself an expert, but I’ve got a decent handle on things like goroutines with the sync package etc.

More

26 March 2016

Make your hubot coffee scripts into reusable standalone programs

In part 1 of this 2 part series on making your module.exports reusable as standalone programs in JavaScript/CoffeeScript, I explained that this pattern allows for flexible reuse of a function like main:

var main = function(args) {
  console.log(args)
}

module.exports = main

if (module.parent === null) {
  main(process.argv)
}

In this article, I’ll show how to make a hubot script that wraps the dig command into a reusable standalone program. Assuming you’re using Linux, OSX, or another BSD and you have dig installed, let’s get started.

More

19 March 2016

Make your Node.js module.exports more reusable as a standalone program

Likely we’ve all written something that is structurally like this when writing helper functions in JavaScript & CoffeeScript (I’ll be using JavaScript syntax in this article, but the principle is the same in CoffeeScript):

module.exports = function(args) {
  //something something here
}

And you’re all set to reuse your something something here anonymous functionalty elsewhere in your application’s codebase.

More