Who do these AWS credentials belong to? (1 mins read).
How to work out whether arbitrary AWS credentials are valid, and if so, what account/role/user they're bound to.
Who do these AWS credentials belong to? (1 mins read).
How to work out whether arbitrary AWS credentials are valid, and if so, what account/role/user they're bound to.
Listing secrets stored in CircleCI (1 mins read).
How to list all the secrets in your CircleCI organisation.
Enabling/Disabling GitHub Issues via the GitHub API (1 mins read).
How to use the GitHub API to update whether Issues are enabled on a given repo or not.
Using Renovate to manage updates to go install
commands (1 mins read).
How to run Renovate to manage dependency version updates for cases where you're go install
ing them.
Using Renovate to manage updates to golangci-lint
versions (1 mins read).
How to run Renovate to manage your golangci-lint
dependency versions, using the official installation script.
Performing arbitrary executions with Renovate (2 mins read).
How to run Renovate for one-off package upgrades, rather than using it for longer term maintenance.
Prefilling OAuth2 scopes for GitHub Personal Access Tokens (1 mins read).
How to make it easier to set up your OAuth2 scopes on a Personal Access Token with GitHub.
Prefilling OAuth2 scopes for GitLab Personal Access Tokens (1 mins read).
How to make it easier to set up your OAuth2 scopes on a Personal Access Token with GitLab.
Performing AND
conditionals in HAProxy (1 mins read).
How to string multiple conditions together in HAProxy to perform an AND
.
Creating a JSON Patch endpoint in Go (2 mins read).
How to create a server-side JSON Patch API endpoint in Go.
Extracting the dependency tree from Renovate for given repositories (4 mins read).
Creating a (hacky) solution to retrieve the dependency graph from Renovate for a set of repositories.
Listing all GitHub repositories in a GitHub Organisation (3 mins read).
How to use the GraphQL API to list all the repositories that can be found in a given GitHub organisation.
Retrofitting OpenAPI documentation to your Rails codebase (12 mins read).
How to take a Rails codebase and introduce OpenAPI documentation and contract tests, in a test-driven manner.
Gotcha: testable examples in Go need an output
comment (2 mins read).
Beware that your Go Example
tests may not actually be running.
Converting HTTP requests to Wiremock stubs, with Go (2 mins read).
How to take an HTTP request and convert it into a Wiremock JSON mapping, on the command-line, in Go.
Using generics to get a pointer to any type, in Go (1 mins read).
How to use Go generics to create a helper method for getting a pointer to any type.
Optional configuration for configuring Go code (2 mins read).
How to use optional types to allow configuring your library's Go code.
Building a Go RESTful API with design-first OpenAPI contracts (6 mins read).
How to use oapi-codegen
to generate an RESTful API using design-first OpenAPI and code generation.
Pointing to a fork of a Go module (1 mins read).
How to pin your Go modules to a given fork of a repository.
Running Go tests in Parallel (2 mins read).
How to get Go tests to run in parallel for speed.
Ignoring slow-running tests in Go (1 mins read).
How to use Go's -short
testing mode to avoid running slower tests.
Automating boilerplate/scaffolding code with custom code generation in Go (4 mins read).
How to use Go's code generation tooling to add custom code generation to your project.
Describing a multi-value querystring parameter in OpenAPI (1 mins read).
How to define a querystring parameter that has multiple values, in OpenAPI.
Stubbing out the Go http.Client
to test an HTTP HandlerFunc
(2 mins read).
How to write a unit test to validate your router's HTTP handlers work, by stubbing out the http.Client
implementation.
Managing your Go tool versions with go.mod
and a tools.go
(3 mins read).
Better dependency management for your tools and without needing to go install
the tools before executing them.
Setting up OpenAPI Contract Tests with a Rails and RSpec codebase (2 mins read).
How to run OpenAPI-driven contract tests against a Rails API.
Only testing your public API in a Go package (3 mins read).
How to test only exported parts of a package in Go.
Describing JSON Patch operations with OpenAPI (2 mins read).
How to describe your JSON Patch endpoints using OpenAPI.
Weirdness with git diff-index
showing 1 file changed, 0 insertions(+), 0 deletions(-)
(1 mins read).
Something weird I hit last week with git diff-index
, which shows 1 file changed, but no changes.
Testing Go net/http
handlers (1 mins read).
How to write unit tests to validate an HTTP handler.
Constructing a serialised YAML string in Ruby (1 mins read).
How to convert a YAML document to a string representation, preserving escaped newlines, with Ruby.
Lessons learned from modernising a lesser maintained (Spring Boot) service (16 mins read).
What I learned from taking ownership of a lesser maintained service and bringing it up to a better standard.
Getting the fingerprint of a certificate in Go (1 mins read).
How to retrieve an X.509 thumbprint from a remote server, in Go.
Getting the OpenID Connect thumbprint for AWS on the command-line with Go (2 mins read).
How to automagically retrieve an OpenID Connect thumbprint for use with AWS' OpenID Connect federated identity.
Setting up a Go package structure for a combined library and CLI tool (2 mins read).
How to structure a Go repository to be both a library and command-line tool(s).
Parsing AWS ALB/ELB access logs into SQLite (2 mins read).
How to take a set of ALB/ELB logs and convert them to an SQLite database for further processing.
When should I use env
to start a command with environment variables? (2 mins read).
When you should use the env
command to specify environment variables when executing a command on the command-line (TL;DR: always).
Should I commit generated Go code? (1 mins read).
Answering whether go:generate
d code should be committed (TL;DR is yes).
Installing Nokogiri on an M1 Mac (1 mins read).
How to get Nokogiri building on an M1 Mac, when using Bundler
.
Determining if there are uncommitted changes in Git (1 mins read).
A one-liner to work out whether there are uncommitted changes in a repository.
Building a fault-tolerant work queue for command-line executions with GNU Parallel (2 mins read).
How to use parallel
to create a lightweight work queue of commands, with retry logic and a record of what's been executed.
Extracting Podcast Addict listening history from the SQLite database (2 mins read).
How to get raw listening history from the Podcast Addict database.
Removing 'smart' quotes from a file, on the command-line (2 mins read).
A one-liner with sed
to replace 'smart' quotes with regular quotes.
Automagically setting the project version for Go projects in SonarQube (2 mins read).
How to automagically set sonar.projectVersion
for Go projects, based on Git tags.
Converting a Byte Array to String from a Node.JS Buffer
, in Go (1 mins read).
How to convert an array of bytes to a string using Go.
Prefactoring: Preparatory Refactoring (2 mins read).
Why I use prefactoring as a means to perform up-front refactoring for codebases, splitting these into separate PRs/MRs where possible.
Protecting an Architect Framework Application with OAuth2 or OpenID Connect Authentication (4 mins read).
How to set up OAuth2/OpenID Connect authentication with an Architect Framework application.
Getting node-canvas to run on AWS Lambda (3 mins read).
Some common issues that occur when using node-canvas on AWS Lambda, and how to solve them.
Parsing the Cookie
and Set-Cookie
headers with Go (2 mins read).
How to parse the value of a Cookie
or Set-Cookie
header to a JSON object.
Generating a Go HTTP Client from OpenAPI schemas (2 mins read).
How to generate a Go HTTP client really quickly and easily, with no manual work, using the oapi-codegen project.