· Comments

Or how to fail fast and avoid catastrophe

In this first X-Files post, I’ll cover the simple yet powerful golang.org/x/time/rate. This package provides a Limiter that controls throughput to an arbitrary resource. There’s a ton of utility in rate, and to show its virtues, I will use it to enforce an SLA on an HTTP service. SLAs and Rate Limiting When creating a new service, it is prudent to specify a service level agreement, or SLA. This promises an expected availability given some...

· Comments

Or understanding the Go packages under golang.org/x/*

This post will be the start of The X-Files, a blog series exploring the Go sub-repositories located at golang.org/x/*. Chances are, you may not have heard them called that before or know where they came from. Introductions are in order… A brief origin story Go promises, with reasonable exceptions, that its compiler and standard library will remain forward-compatible for all minor releases of the Go 1 language specification. This is incredibly refreshing, especially if you’ve...

· Comments

Or the many ways to skin a cat — er — stream

I have fallen in love with the flexibility of io.Reader and io.Writer when dealing with any stream of data in Go. And while I am more or less smitten at this point, the reader interface challenged me with something you might think simple: splitting it in two. I’m not even certain “split” is the right word. I would like to receive an io.Reader and read over it multiple times, possibly in parallel. But because readers...

· Comments

Or how to stop working directly on your production site

There seems to be a common complaint that working on WordPress plugins and themes locally is difficult to accomplish. If you only need to manage a handful of plugins or a couple themes, the tedium of setting up a dev environment isn’t too complicated; you would probably just have a single install of WP on a MAMP server. As my 8th-grade english teacher would say: done, like a cupcake! Things start to get real messy,...

· Comments

Or building documentation right into the WP admin

New post on the CNP Blog today covering a little-known (or perhaps little-used) feature of the WordPress Admin: custom contextual help tabs… If you are familiar with the WordPress admin, you probably noticed the “Help” tab at the top right of nearly every screen. Clicking this little gem reveals a series of helpful topics related to the current page. For example, on the Dashboard, the tab offers an overview of what’s currently displayed, how to...