Darragh ORiordan

Hi! I'm Darragh ORiordan.

I live and work in Sydney, Australia building and supporting happy teams that create high quality software for the web.

I also make tools for busy developers! Do you have a new M1 Mac to setup? Have you ever spent a week getting your dev environment just right?

My Universal DevShell tooling will save you 30+ hours of configuring your Windows or Mac dev environment with all the best, modern shell and dev tools.

Get DevShell here: ✨ https://usemiller.dev/dev-shell


List of article summaries


How to add canonical meta tag in NextJs

It’s important to add a canonical meta tag to your pages to improve SEO or to avoid issues with query params in crawled pages.

You can easily add a canonical meta tag in NextJs by using the next/head component.


Open Telemetry in NextJs and NestJs

I wrote about how to use open telemetry with NestJs and React previously.

I wanted to add open telemetry to my NextJs app that calls a NestJs backend. The paradigm of SSR preferred by NextJs is a bit different than the CSR paradigm of React.

I’ll describe the differences and how I added open telemetry to NextJs that propagates to other backend APIs.


Comparing next start and next standalone with docker

I wrote about how to use nextjs with docker.

I wanted to compare using next standalone like in the article and just using next start.


Force RSA key support for Azure DevOps Git SSH

If you’re using Azure DevOps Git SSH you have to use an RSA key. This is because Azure DevOps doesn’t support the newer ed25519 keys (at time of writing). However newer versions of OpenSSH prefer ed25519 keys over RSA keys.

You have to force OpenSSH to use RSA keys for Azure DevOps Git SSH. You can do this by setting HostKeyAlgorithms and PubkeyAcceptedKeyTypes in your ~/.ssh/config file:

Host myazuredevops
HostName ssh.dev.azure.com
User myusername
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
PreferredAuthentications publickey
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
IdentitiesOnly yes

Then you can connect to azure with git clone git@myazuredevops:myorg/myrepo.git. Just replace ssh.dev.azure.com with myazuredevops


Npm package provenance with Github Actions


Npm has added a really nice signing feature to the registry for the first time! Package authors can sign package builds for free and clients can verify the how a particular package version was built.


Cheatsheet: Environment variables and precedence in Docker Compose


Docker compose evaluates inline variables in the docker-compose.yml file.

There are some ways to provide defaults or override these variables with interpolation.

I can never remember the various ways to do this so I’m writing this cheat sheet for myself!

Variable Interpolation

  1. ${VARIABLE:-default} evaluates to default if VARIABLE is unset or empty in the environment.
  2. ${VARIABLE-default} evaluates to default only if VARIABLE is unset in the environment.
  3. ${VARIABLE:?err} exits with an error message containing err if VARIABLE is unset or empty in the environment.
  4. ${VARIABLE?err} exits with an error message containing err if VARIABLE is unset in the environment.

Running NextJS in a Docker Container


This is a guide on how to run a NextJS application in a Docker container.

NextJS apps usually require some kind of backend server to run.

NextJS is created and maintained by Vercel so it works great on their hosting service. Vercel is an amazing service that allows you to deploy your NextJS application with ease.

However, there are times when you may want to run your application in a…


Building an AI generated game with Stable Diffusion and data from Wikipedia

Last week I released a game called Doodle:ai.

In the game you’re shown AI generated images and you have to guess the Wikipedia topic it used to create the game.


Easiest way to optimise images for web

Here is how I optimise all pngs and jpgs in a folder for publishing to the web.


Start tracking DORA metrics for your team in just 15 minutes with Apache Dev Lake

DORA (DevOps Research and Assessment) metrics are an excellent way for engineering organisations to measure and improve their performance.

Up until now, monitoring the DORA metrics across Github, Jira, Azure Devops etc required custom tooling or a tedious manual process.

With Apache Dev Lake you can get beautiful reporting for DORA metrics on your local machine in as little as 15 minutes (honestly!).

From Google Sheets to Grafana
From Google Sheets to Grafana


A summary of NDC Sydney 2022 Developer Conference

I attended my first in-person conference for more than 3 years last week! NDC is one of the more well-known developer conferences in Australia and New Zealand. It’s a 5 day conference with 3 days of talks and 2 days of workshops.

There’s so much to learn across all the streams so I try to take notes for each of the talks to quickly reference them later. This post contains all my notes. I’ll add the relevant videos to talks later if they’re released.

A reminder that these notes are just my notes. They’re paraphrased and summarised from what the speaker actually said. Each speakers would have provided must more clarity and went into more detail during their pressos!


4 Surprising uses for GitHub as a cloud datastore

GitHub is a great place to store code. But it’s also a great place to store any data that you need backed up, versioned, accessible from anywhere and easy to use.

In this post I’ll show you some surprising uses for GitHub as a datastore like…

  • as a comments system for a website
  • as an operating system configuration management tool
  • as a datastore for personal data management
  • as a software update delivery platform
  • as a host for sharing any kind of raw file online

Obsidian - A free personal data management system on windows, mac and mobile

Obsidian is a free personal data management system based on markdown notes. Because it’s based on markdown it’s perfect for developers or other power users.

Obsidian has a healthy plugin ecosystem for extending the base functionality. There are plugins for mind mapping, kanban boards, importing amazon kindle highlights, daily notes and using git as a backend.

Obsidian has a powerful search engine that allows you to search for notes by their content, tags, and even the content of the notes they link to. This linking technology is what makes Obsidian so powerful.


How add comments to your Gatsby site with utterances

If you want to add comments to your blog quickly there is a nice tool called utterances that uses a GitHub Repo as the api.

Here is how I setup utterances for my gatsby blog in typescript.


How to use SSH with Git and ssh-agent on Windows

I needed to run git natively in windows (no wsl) for a recent project. I use ssh certificates with passphrases to authenticate with my git provider.

Ssh requires the certificate passphrase every time you use a connection. It’s annoying typing this passphrase in to terminal when using a git command.


How to fix custom type definitions not being type checked

If you have a custom types file (e.g. myTypes.d.ts) but you get no errors from the type checker and compiler in typescript even though you know there are issues in the file you might have skipLibCheck turned on.


Should you work for a consultancy or a product company?

I’ve recently crossed over 2 years in a software consultancy. Previously I spent around 10 years working in product companies.

As you can imagine there are some differences between them and I wanted to write down some of the things I’ve noticed.


PostgreSQL and typeorm - Caching

With most web applications you can drastically increase performance by using caching for data that’s frequently read across network boundaries. This lesson will explore some common caching techniques, you’ll learn how some common tools and libraries provide caching for us.

While caching helps with performance it can also cause some surprises and bugs in applications and i’ll discuss some of those too.


How to run Monica personal CRM on Dokku

I left my home country right after university and I worked and lived in a few countries since then. I’ve met lots of amazing people but I’ve always struggled to remember contact details and important dates for everyone.


Flexible work is here to stay but you should choose an emphasis

Note: This was written in August 2022 and I assume things will change quickly. It will be interesting to look back in a couple of years to see how much of this article is still relevant!

Most tech organisations were forced to change to remote during lockdown but haven’t explicitly changed their office attendance policy.


Find 20% of missing site traffic with plausible analytics and some proxying

Google Analytics (GA) has been a force in web site metrics since 2005. The metrics have always been incredibly useful but it’s a “free” product so you pay for it by providing all your site data to Google for tracking and advertising.

With Google Analytics your metrics are tightly coupled with tracking and advertising so when ad-blockers kick in to block tracking they also block your metrics!

The good news is that this is all fixable!


Open Telemetry in NestJs (and React)

Open Telemetry is good enough to use in production projects now and most cloud providers and telemetry services have integrated open telemetry into their products.


PostgreSQL and typeorm - Relational data

Lesson goal

In this lesson you’ll learn about relational data with typeorm and postgres.

We’ll also cover entity relational diagrams, running database migrations and some special relations in typeorm.

Database course index

This is part of a full course on persistence in postgres with typeorm and sql!

There is a github repo to go with this course. See part 2 for instructions.

Relations in RDBMS



PostgreSQL and typeorm - A glossary for database administration

Lesson goal

You will learn about some things that you might come across when discussing database administration with other engineers and DBAs.

Database course index

This is part of a full course on persistence in postgres with typeorm and sql!

There is a github repo to go with this course. See part 2 for instructions.


This is a website that can help you to set the basic settings for a db…


PostgreSQL and typeorm - Practical transactions

Lesson goal

To understand what a transaction does for us and how to choose when one is required in our code.

I will also show how to add transactions using typeorm.

Database course index

This is part of a full course on persistence in postgres with typeorm and sql!

There is a github repo to go with this course. See part 2 for instructions.

The problem with multi-user apps

We need databases to be…


PostgreSQL and typeorm - Advanced Querying - (Aggregations, AND, OR, BETWEEN for Dates)

Lesson goal

After this lesson you will be able to recognise and use the most common querying capabilities in postgres used in line-of-business applications.

Database course index

This is part of a full course on persistence in postgres with typeorm and sql!

There is a github repo to go with this course. See part 2 for instructions.

Dates and times in Typeorm

There are date only and time only database types in postgres but I rarely see them used. A timestamp with timezone (timestampz


PostgreSQL and typeorm - Getting a local Postgres instance

Lesson goal

  • Set up a local instance of postgres for learning
  • Learn where to get a production database

Database course index

This is part of a full course on persistence in postgres with typeorm and sql!

There is a github repo to go with this course. See part 2 for instructions.

Why use Postgres?

Postgres is a relational database but it’s designed and actually used in production for a range of…


PostgreSQL and typeorm - Intro to persistence


This database course is designed to help you get into the world of persistence with typeorm and postgres when working on projects with nodejs or just typescript.

By the end of this course you’ll also have a strong vocabulary for discussing persistence in any scenario so you can find answers to any database questions online or from your colleagues.

This first module is an introduction…


Consistent modern shell tooling on MacOS and Windows WSL for developers

I regularly code on both MacOS and Windows machines and I was always annoyed how different the default experiences are on each. I need to use the same tools and the same experience on both.

Windows “WSL” (Windows Subsystem for Linux) is a great tool for this you can use on Windows 10 and newer. The latest version lets you run a full Ubuntu instance that integrates seamlessly with the underlying windows instance.

By using WSL2 you can have a (mostly) identical developer experience jumping between MacOS and Windows.

Better tooling for Developers

Many of the terminal tools that come with unix environments are functionally similar to how they were 20 years ago. But other developer tooling has advanced quite a bit since then.

You can replace tools like ls or cat with modern equivalents that support full colour, unicode icons, git state and more. Terminal prompts can be made git aware and use colour to indicate state so you don’t have to query git so often.

Keeping developer experience consistent across machines

Keeping any shell changes you make on one machine up to date on all the machines you code on is a nightmare without the right tooling.

This article also explains all the tools I use and how I keep the same terminal setup consistent on MacOS and Windows!

Let’s go!


Hiring engineers in a candidate-driven marketplace

I’m writing this at the start of 2022 and it’s never been tougher to hire engineers. There is a very strong candidate market in software engineering at the moment.

There are roughly 1 million open software engineering roles in the USA and somewhere around 200,000 candidates. The rest of the world is having similar issues hiring engineers. Most people seem to think it will be this way for quite some time. There just aren’t enough engineers as software becomes more important to every industry.

When I started my career getting hired was skewed in favour of the hiring organisation. A candidate had to have a degree and there was no remote work so your choices for where to work were limited.

Now, in 2022 candidates with a couple of years of experience are in high demand and practises for hiring have changed significantly. You can work anywhere across a few time zones and university degrees thankfully aren’t necessary any more.

I’m mostly on the other side of interviews these days, so my are tips for other folks trying to hire engineers during these tricky times!


How engineers can help deliver software effectively

Delivery managers and team leads have the responsibility to deliver a software system via an engineering team.

Your customer wants every feature to work perfectly and they want it delivered yesterday. Your team wants to learn and grow.

It’s a tough role managing all the stakeholders and creators in a project.

Engineers can help drive great delivery by empathising with and supporting the delivery manager or leads in a project team.


Engineering systems for consistency and impact

Your most impactful engineering is done before you write any code.

It’s important to have some systems around how you approach problems to make sure you’re consistent every time.

These are some of the techniques I use to make sure I’m covering as many angles as possible when doing my pre-coding engineering.


How to identify a great tech organisation before you join

No one wants to waste time working for an organisation that’s a bad fit. But how do you know a good place from a bad place until you actually work there?

It’s important to spend the same amount of time analysing a potential organisation as they spend analysing you!

During an interview process an organisation has personality testing, resumes, tech testing, behavioural testing, reference checks, bank checks, police checks and more.

If it sounds like a very one-sided process that’s because it is! But there are ways you can bring more balance and here are some important things to research before accepting any engineering job offer.


How software engineers can avoid commoditisation

Engineers spend most of their learning time on technical implementation content. Things like new frameworks, languages or cloud platforms.

But turning solutions into code is a tiny part of what you do and it’s getting less valuable year by year.

As we’ve seen with “no-code” and tools like GitHub Copilot, the implementation part of our role is increasingly becoming commoditised.

You could generalise that the value an engineer brings to a team is their ability to analyse problems and synthesise context. The part of your role as an engineer that will never be replaced by “no-code” or AI is this high level cognition.

The true human aspect of being an engineer is working in a team and considering other people’s ideas, emotions and thoughts while solving these problems.

So shouldn’t you train these meta-cognition skills as much as you train the specific technologies?

Every engineer should spend time learning and applying general tools for thinking. These tools are applicable to almost all problems so the compounded payback on your invested time is huge.

Clearer thinking will amplify all the other skills you have and any frameworks or tools you learn will give you results for the rest of your career.

Like any skill, improving the way you think takes deliberate study and practice.

These are some of the tools and systems for thinking that I refer back to all the time.


Running a NodeJS app with Postgres in Dokku

I have some side projects that don’t see much traffic so I run them on a 5$ Digital Ocean droplet running Dokku.

Dokku is an open source Heroku-like platform. It’s super easy to create and maintain multiple applications on a Dokku instance. It’s perfect for solo makers.

There are plugins for most of the common services you might want like PostgreSQL or Redis.

Here’s what we’re going to do

  1. A Brief overview of Dokku
  2. How to get a Dokku instance running
  3. Create a new Dokku application
  4. Add a database service
  5. Expose the database for debugging and testing (Optional)
  6. Add a domain to the application
  7. Add any configuration variables for your application
  8. Add SSL to the application
  9. Add the Dokku remote to your application
  10. Push your application to Dokku
  11. Maintaining your Dokku server

20 questions for a valuable code review

I recently had an interesting discussion around the value of doing code reviews and the value of mandatory code reviews.

I think code reviews are extremely valuable and should be done by most organisations and teams.

A valuable code review will

  • pass institutional knowledge around the org
  • help all engineers grow their skills
  • maintain quality in the face of all the other time pressures your team faces

But how do you keep a code review valuable?


What are domain names, nameservers and IPs when setting up a Squarespace site

I recently helped a colleague setup a domain on SquareSpace. They asked me to explain why the configuration was required and what it was doing.

So here is my attempt to briefly explain nameservers and DNS for anyone setting up a domain on a SquareSpace account.


10 Useful product-thinking lessons for engineers

Have you ever struggled to explain the business value of a piece of engineering? Like why a particular piece of tech debt needs to be paid down now?

Engineers can learn from the techniques and rigour that product management practice has created in the past few years to

  1. To show business value in their own engineering work where it’s not easy to articulate
  2. To empathise better with customers of the software their building
  3. To understand the business context you’re in

For example, how can you know that you’re building something useful for your customer? How can you convince others that you’re not ahead of your time with an engineering solution?

For engineers there are some product development lessons that will improve your empathy and communication with non-engineers in your org.


Minimum viable discovery and software estimation for engineering work

I recently had to estimate 6 months of work for a new product after just 2 hours of discovery. This is a short deadline for an accurate estimate and I felt uncomfortable providing a number.

I ultimately gave a gut feeling estimate for the work because that’s my job and we needed one by the next day. I did specify it was at least 20-30% wrong and highlighted the major risk I saw - a new third party integration that we had never integrated with before.

The whole scenario got me thinking about what works and doesn’t work for me when estimating larger pieces of work. Here are some of the thoughts, tips, tricks and learnings from 10 years of providing dodgy software estimates!


How to write an ESLint plugin in TypeScript

I use NestJS at my day job. It’s a complicated framework sometimes and there are lots of things that devs “just have to remember” or there will be bugs in your application that you won’t see until runtime.

I wanted to remove this cognitive load from NestJS engineers so that they can focus on valuable work instead. I wrote an ESLint plugin to alert developers directly in their IDE or editor when these common issues exist - (Available on NPM) https://www.npmjs.com/package/@darraghor/eslint-plugin-nestjs-typed

Here is what I learned about writing ESLint plugins in typescript for typescript while building the plugin.


A Nest JS Pipeline Cheatsheet

I’m always checking the NestJS documentation to read what a Middleware Vs Interceptor is and I could never remember the order that the different NestJS pipeline elements are called in.

So I made this cheatsheet for myself so I had something to refer to.


Using a dynamic DTO property in a NestJS API

NestJS is designed around using strictly typed properties on models but sometimes it’s useful (and fast!) to allow dynamic types on properties and just store some business domain data as a dynamic serialized blob.

This is the serialized LOB method recommended by Martin Fowler (https://martinfowler.com/eaaCatalog/serializedLOB.html).

Here is how you can have a LOB in a NestJS REST Api with type safety and support for OpenAPI definitions.


Automatically setting empty arrays instead of undefined on typeorm entities

If you have an array on an entity model in typeorm you will have to handle the response when there are no items available to put in the array.

In my application I return the entity model directly for GET requests and I like having arrays as empty instead of undefined properties.

By default typeorm will not set the property to [] so it will be undefined.

Here is how to set an array property to have an empty array instead of undefined.


npmrc authentication for a private scoped organisation package

When you have to login to npm for multiple organisations it can be easier to use an .npmrc file that you move around rather than npm login command.


Fixing validation error in NestJS when using forbidUnknwonValues

If you get unexplained validation errors (http status 400) when calling a NestJS api you might want to check your Query() parameters. Parsing and validating these the wrong way can cause issues.


Semantic versioning javascript projects but skipping NPM publish

If you want to use semantic versioning and automate release versions using semantic-release for your front-end client application you probably don’t want to actually publish it to npm.

Here is how to use semantic-release while not releasing to npm.


How to validate configuration per module in NestJs

I needed to configure an application with NestJs and I used the built in ConfigModule.

I wanted to have a configuration service that was specific to a given module to maintain the modularity of my application.

I also wanted to validate the configuration values. It wasn’t clear from the nestjs documentation how to achieve a configuration service for a feature while also validating the properties. Here is how I did this.


Set vscode as the default editor for text files on mac

If you use VSCode you might want to set it the default editor for all text and code files on your mac.

I’ll first describe how to configure vs code as the editor when you open a file in Finder. The second section will describe how to set code as the editor in shell and git.


Convert a Microsoft Word document to markdown

How to convert a Microsoft Word document like .doc or .docx to markdown.


Extract user profile attributes from an Azure ADB2C tenant using the Microsoft Graph API

I had to retrieve a list of users from an Azure Active Directory B2C instance today. I thought I could just go through the Azure UI but that’s limited to short pages of data and limited attributes.

There is a CSV export provided on the UI but you won’t get the required identity objects in the csv output if you need a user’s signin email address.

I had to use the Microsoft Graph Api to get what I needed. This is a bit hacky but it does the trick!


Are tools like GitHub and Jira artificially restricting improvements to your practices?

Just like modern product development, the best practices for your team also come from learning, iterating and adapting to changing requirements. There are no “best practices” that can be applied to all teams and the way you work will likely be unique to your team’s requirements and outcomes.

Applying a software tool like Jira or GitHub PRs locks a team in to the tool’s practices. The team’s practices become tightly coupled to the tool’s prescription.

The danger here is that the tool accidentally becomes “the way we do it here”. The original reasons the tool was chosen are forgotten and it’s more difficult to experiment with better practices when your team is artificially bounded by a mandatory tool.


Avoid these issues when using new ECMAScript modules in your Node.js application

ECMAScript modules are the official standard format to package JavaScript code for reuse in the future. Es6 modules now have full support in Node.js 12 and above so it’s time to start using them.

JavaScript developers and node libraries have typically used commonjs for modules up to now. If you’ve used typescript in the past few years you will be familiar with the module import syntax in you application. Instead of commonjs require("module") most typescript applications use some variation of import module from "module".

Typescript will then transpile this import syntax into commonjs require statements for you. This step is not necessary in modern Node.js applications. You can just use import module from "module" directly in your transpiled code.

If you use typescript you can change just change your tsconfig settings to output ECMAScript es6 modules and you will be good to go. If you don’t use typescript you might have to do some rewriting if you want to get your app updated.

Here are solutions to the issues that took me a bit of time and investigation to figure out when I was upgrading my Node.js application to use ECMAScript modules like configuring typescript, setting up jest, configuring the package.json correctly and more.


3 markdown editing tips I wish I knew when I started blogging

I write markdown documentation everyday. I use it for documentation at work and I use it for my blog. I love the simplicity of it.

Over the years I’ve learned theses tips and I wish I knew them when I started.


8 ESlint plugins for your NodeJs app

Using Eslint in your project is an easy way to improve productivity and reduce low-value, subjective code-style comments from pull requests. It will make your code consistent and easy for the next developer to read and we should always be optimising for readability.

Using some specific Eslint plugins will also prevent real bugs and security issues in TypeScript and JavaScript applications through static analysis.

Here I’ll explain why it’s so important to use ESLint in your application and I’ll describe the plugins I always add to every new NodeJs application to massively improve code quality and consistency.


Force restart your Azure App service site and host

Sometimes your Azure App service host will need to be restarted. You can do this but it’s hidden away in the Azure resource manager site. Here’s how to find it!


How to parse the raw body of a request in a nest js controller

I recently needed to parse the raw body in a nestJS application to validate a webhook from a third party service. The key to this was using the json validate method to read the raw body in to a variable before passing the request on to the next middleware.


I wrote an eslint module for checking NestJS modules and Open Api/swagger decorators

NestJs is a nice backend framework for NodeJS web applications. It makes heavy use of dependency injection and decorators. It can be difficult to remember to use them all correctly so I created an eslint library to catch some of the common issues I’ve had myself.

I’ve described the rules below. Let me know if you try it out and have any issues or suggestions!


Fixing "env: node\r: No such file or directory" on mac for an npm package

If you install an npm package using yarn and you get this error it means that the package author is using windows line endings and Node.js on mac can’t run the script as expected.

env: node\r: No such file or directory

To fix it you need to change the line endings. But you need to ensure this happens after each install of packages!


Migrating a Create React App (CRA) application to Vite

I had an existing app that was scaffolded using create react app (CRA) and extended with craco. CRA didn’t support the tooling I needed so I had to look for an alternative. I found Vite.

There are some incredible improvements in Vite over CRA, including PostCSS 8.0 support so I decided to migrate my production application.

I’ll explain some of the benefits of Vite and describe the steps you need to take to upgrade your application.

Update October 2022: I changed @vitejs/plugin-react-refresh to @vitejs/plugin-react. The former is deprecated now.


Configuring different work and personal github accounts on your local repositories with ssh authentication

If you have multiple GitHub accounts like personal and work then it’s important to use the correct account for each repository so you don’t accidentally commit to one with the wrong GitHub account!.

Each git client has built in ways to do this with http authentication but http authentication tends to only be set with the specific git client and applies to all repositories you have in the specific application.

Using http authentication also often means that a different user will be used in shell git compared to your GUI client.

If you want to use the same connection authentication for a git repository from any git client like shell, source tree or the GitHub client then it’s worth setting up ssh for the GitHub account(s) and configuring the repositories to use it.


Scheduling a feature toggle using no-code with Azure Logic Apps

I use launch darkly to toggle features on an app. There is one third-party dependency that has regular scheduled maintenance and I need to toggle the feature on and off on schedule.

Launch Darkly has built in scheduling to handle this scenario but you have to be on the enterprise plan to use it. The enterprise plan is too expensive to upgrade to for scheduling alone so I needed to find a different way to automate this.


Fix React Router navlink-exact when activeClass is not working

If you’re adding navlinks with react router because you want to set the active class you might find that it doesn’t work. These are the steps I had to take to make this work.


Create an only ever true boolean type in typescript

Integrating with an API where a boolean can only be undefined or true I needed to type it. It’s easy enough but I just wanted to jot it down in case any one else needs this in the future.


Use regex replace in vscode find

I needed to replace text that was a bit specific and to use vscode’s regex replace but had to figure out the syntax. Just making a note here for myself so it’s easy to lookup again!


How to use Git rebase to change commit history

I had to change some of my Git history because I had used the wrong Github user to push some changes to personal projects.

I just needed to change the user that committed the code without changing any of the other history. I don’t use rebase very often so here are my notes on this.


How to list files changed in current branch (and run prettier on them)

I needed to run prettier on only the files changed in one branch of my git repo. This solution is a bit hacky but it did the trick!


Avoid rebuild of React App in every CI stage

If you have a react app you can use env vars like REACT_APP_MY_ENV_VAR in your application and React will automatically pull them in to your app when you build the production application.

This is very useful but if you have variables that change for each environment and your application build takes a long time, you might want to avoid building unnecessarily in CI. For example you might have a QA environment and a Staging environment that have different configuration.

We type-check our code on each build and that was taking 5 minutes+ to build each environment so we had to make it faster. We changed our app from using REACT_APP env vars to using a configuration file that we could quickly write to using CI.

Our CI system is Azure DevOops so the CI scripts here are specifically for Azure DevOps but they apply to most CI systems with small changes.

The real work happens in a Node.js script that would work anywhere.


How to save an exit code to a variable in bash script

I had to save the exit code from one part of the script that runs a suite of tests, then run some cleanup and finally return the exit code received previously from the tests.

I haven’t used bash scripts too often in my work so when I had to do this recently I had to spend some time looking up syntax.

This will fail the tests correctly in our Azure Devops pipeline while still cleaning up the docker containers.


Automate Jira releases from Azure DevOps pipelines and save 1 hour per day

My team uses Jira as a project management tool and we use the “Releases” feature to audit our releases and to update our customers.

Atlassian provides a UI to create releases on Jira but we wanted to automate these types of things as much as possible to maintain our level of continuous delivery.

If you use Node.js and Azure devops you can use Semantic Release to create the release in Jira. I had some trouble figuring out the Jira key format and wanted to share that bit with you. Otherwise the plugin does all the work!

We save an estimated 1 hour per day depending on how many releases we create in a day. Usually 4-5 releases.

By automating a process like this you know it will always be accurate (and not forgotten about)!


Transitioning from startup development-mode to iterating a software product

Building a new product likely means you’re building as quickly and as scrappily as possible to get to market. For a web app this is usually a short push of 2-4 months and If you’re successful you now have a product that needs to transition to a more sustainable style of development.

Here are some of the things I’ve observed or implemented to make this transition deliberately. Hopefully there are some things here you can use to prepare yourself for transitioning your next successful project!


How to change the type of output for a property filter in typescript

If you have an iterable filter on a property in typescript you might have a slightly different model coming out of the filter based on the filter condition.

By setting the types correctly you can potentially save having to add manual typing hints in whatever follows the filter.

It’s easier to show this with code so see below!

Thanks to one of my colleagues for suggesting this one in a code review.


How to log a Node.js object with circular references to the console

If you try to use JSON.stringify() on a NodeJS object you will get an error “Converting circular structure to JSON”. This is because NodeJS objects have circular references.

The way to stringify NodeJS objects is to use util.inspect().


Copying missing files during a typescript build on deploy

If you build your nodeJS project using typescript, it’s important to know that the typescript compiler tsc will only include files that are .js or .ts.

If you have an issue where you deploy or build a typescript project and you get a file not found issue or similar, it’s probably because you missed that typescript does not process these kinds of files for you.

If you need to include files like XML (.xml) or images in your typescript project build output, you will have to copy them manually before or after the build process.

This is one way to copy assets in a typescript build.


Anonymous vs direct feedback

Many organizations use an anonymous feedback mechanism to get feedback from their employees.

However, if you only emphasize an anonymous feedback mechanism or your team is asking for an anonymous feedback mechanism take it as a HUGE red flag around trust.

The people don’t have any safety to talk about their issues with the organization or colleagues in a transparent way. You should do everything you can to provide trust and safety for transparent feedback.


Improving engagement in your org that uses the Spotify model

The “Spotify model” is an incredibly popular organizational methodology for managing work across teams. Personally it’s been present in some form in the last 4 places I’ve worked since 2014.

The Spotify model is a matrix organisational model that highly values team autonomy with servant leadership.

Now the critical thing is that you have to enable the team to be autonomous! You need to support the team members at their various levels of experience on how to be autonomous and effective. If you do this you will also get higher engagement in your culture and the actual work.


for of .. vs for in .. vs for ..

Sometimes I forget what the best use of the various for loops are in JavaScript or typescript. This is a short one to remind myself when to use each one. Coming from C# where foreach .. in is the statement for iterables it’s important to remember the equivalent in JavaScript is for .. of.


Creating a guid in mac OSX command line

Note for myself on how to create guid or uuid on the command line in mac osx.

Converts to lowercase.


Ensure Node.js version is consistent on Azure services and devops pipelines

I got caught out with Microsoft recently setting the default version of Node.js from 12 to 14 on Azure pipelines linux build agent images (ubuntu-latest). Here are some tips for ensuring Node.js versions are set correctly in some of the popular Azure PaaS offerings.


Setting and debugging Azure Devops yaml env vars

I received an interesting question yesterday that highlighted how some parts of environment variables in Azure devops are not clear. Here are some things to check if your environment variables aren’t working in azure pipelines.


Adding Visual Studio Code debugging to Node.js JS projects

I find it useful to be able to debug my Node.js application in vscode. It saves you having to write console.log statements to figure out why something isn’t working. I sometimes use the debugger to check my tests too. This is the configuration I use to setup debugging for the main application and the tests.


Password protect zip file on mac OSX command line

Short reminder for myself on how to password protect a zip file on Mac OSX command line.


A snippet for exporting an Azure App Service ssl certificate for use with Azure front door

Azure app service ssl certificates do not have a password but other Azure services only allow importing of certificates with passwords set. So this is the openssl snippet required to export the certificate and add a password


Using Gource to visualize activity on a git repository

At the end of a project or when a person is leaving a team or project, it’s nice to show the impact that they had on the software visually. Git has some built in statistics that will show you tables listing additions and deletions, commit counts and that kind of thing. But you can use gource to create a cool time series visualisation showing the changes over time.

It’s well worth checking out this tool.


Performance measurement decorator for Azure Application Insights on a Node.js app

I’ve been writing lots of Node.js apps on Azure recently. Azure provides an instrumentation product called Application Insights. The App Insights client hooks in to Node.js requests and other popular parts of the Node.js ecosystem like postgres with almost no configuration.

However If you want to use the performance measurement api you have to actually call the app insights Node.js client api method. I figured since this was measuring some wrapped code anyway it would be a great candidate for an es6 decorator.


Notes on testing some notebooks - Rhodia, Leuchtturm and Moleskein

I’ve always preferred using a real notebook for jotting stuff down while working at a computer.

I started out using no-name notebooks but I’ve slowly moved to using better quality notebooks.

Here are my notes on some popular decent notebooks!


Five quick jest and typescript tips

I’ve been working with jest every day for the past month or so. I had to learn a few tricks as I went. I was mocking, using async, upgrading versions and working in vscode. Here are five things I learned.


Using no-code airtable and Netlify to quickly build a machine log application

A friend asked me to create a tool for logging when one of his staff enters a room to turn on and off machine jobs. It needed to be on the cloud and run on an ipad. He wanted it to be simple and have an MVP fast.

I wanted to see if I could build the tool using no-code or similar. I got it built in around 2 hours using airtable! Though I found that I needed a tiny bit of code to make it more professional by having it on its own url.


How to use a private NPM repo in Azure Pipelines Deploy

If you have a private a npm library you need to authenticate to get the packages you need. Pipelines provides a specific task for this but you also need to take another step to get the package when installing on the host…


Semantic versioning a Node.js app on Azure DevOps CI

Using semantic versioning allows you to completely automate updating versions in package.json and remove any arguments in your team about versioning. Here is how I use it in my Node.js apps.


Azure App Service reuse Node.js modules on host for speed

If you are deploying a Node.js app to Azure App Services you can deploy the node_modules folder as part of the deploy, or you can reinstall the runtime Node.js modules on the host each time. There are some advantages and disadvantages to taking either option.


Which http status code to use for no search results found?

I was implementing a search REST API and was thinking about the no results status. There are a couple of options that are somewhat valid. There is no perfectly “right” answer and the discussion exposes care for API design, knowledge of http and care for developers who will be consuming the api.


Add AWS OpenApi extensions to your Swagger specification on NestJS

I recently had to add open api extensions for an AWS gateway to the output of Nest’s swagger/openAPI tool. This is how I did it and what I learned.


@Decorator caching in NestJS with type-cacheable

I needed to cache some data in a NestJS application. Nest provides an awesome module for caching responses from nest http or microservice responses from controllers. But this Nest caching module doesn’t easily allow you to cache from any method using the decorators.

class MyService {
  // I wanted this: Cache whatever the output of the method is based on the key (id in this case)
	@Cacheable((args: any[]) => args[0], ttl:TtlSeconds.ONE_MINUTE)
	public get(id:number): SomeModel{

TSLint is deprecated: how to upgrade to ESlint

I recently upgraded my production typescript project from TSLint to ESLint. Here are the steps and and why I migrated manually.


How to setup TSLint and Prettier for TypeScript projects

UPDATE 10/10/2020: Tslint is being deprecated. You should consider changing to Eslint. I have a guide for that here: TSLint is deprecated: How to upgrade to ESlint.

TSLint will help us identify potential issues in our code by examining how we use language features.

Prettier will format code consistently but needs some configuration to work with TSLint.

Together they make code-reviews easier and faster because if you run both of them you will identify many common code review errors before pushing your code.

There needs to be some configuration to have both work together. Here is my cheatsheet for setting this up on a project.


10 RFP response signals to watch out for

When you’re reviewing RFP (Request for proposal) responses you make sure that the provider has met all your specified requirements. A provider missing a requirement on the proposal is a bad signal. Then you weigh the response details against each other and finally the price gets calculated and you choose.

But here are 10 specific signals outside of the standard stuff above that I look for.


How writing more allows you to have fewer, more effective meetings

According to research by Professor Steven Rogelberg 50% of meetings are seen as engaging, of course this suggests that 50% are not!

From my own experience I would have to agree that many meetings are not very useful. There are too many organisations having meetings that would be better as an email or a wiki document.


Should I apply for a team lead role if I'm not 'technical'?

I was asked for some advice recently - “Should I apply for this open team lead role if I am not technical?”

In this case I found out that “technical” meant “is a software engineer”.

If you’re employed in a software product development organisation already then the short answer is yes, you absolutely should.


4 hacks for lazy team leads

I’m a lazy team lead. I like to ‘free up’ as much time as possible at work. I run away from ‘busy work’ like it’s on fire. Here are four rules of thumb I use to decrease the amount of time I spend doing some management stuff so I have time to think and work on more valuable things.


How I enhance pull request quality on GitHub and Azure DevOps

Code reviews and PRs are deservedly known as a fantastic way to improve code and product quality.

I find that having a checklist is super handy for remembering all the checks to perform and the context to give a reviewer.


How to prioritize too many feature requests

There’s always more work to do than time available to do it. Effective prioritisation is very important to provide the focus to be successful at work.

In general prioritisation is some product of effort x cost x time or value x complexity applied to possible tasks. The tasks should be aligned to your strategy.

There are some well known frameworks for prioritisation that I find useful. I’ll describe them here and talk about how to choose one with your team.


Some errors to avoid in JavaScript

I was refactoring some legacy JavaScript recently and saw some things I needed to improve.

Here are the things I noticed with some descriptions.


Refactoring conditionals to strategies (in .Net/C#)

I’m doing some work on a legacy code base and there are some common refactorings I do over and over. One of my favourite improvements is making long lists of conditionals easier to read and especially test.

I use the common refactor-to-strategies pattern from Martin Fowler to deal with these.


Deliver 30% more PRs to production by having developers own their own testing

Is testing “slow” in your team? Do tickets pile up in the “ready to test” column every sprint?

If you think that the testers on your team need to fix this you’re wrong!

In a cross-functional product development team balancing the cadence and handover between development and testing is often a pain point. Read on as to why this is team problem and it’s best resolved by getting developers to thoroughly test their own work.


Debugging specific mouse clicks in JavaScript

I recently needed to trigger the chrome debugger on a mouse click from an element that gets popped up based on a previous mouse click. The problem was that the code is old jQuery code that manually set handlers and it was all a bit spaghetti. I didn’t know where the click was registered to a handler or which parts of the code ran afterwards so adding a debugger; call wasn’t a great approach this time.


How to send a slack webhook message for an Azure DevOps pipeline task

I wanted to send a slack message when a deployment completed on Azure. It’s fairly straightforward but there are a couple of things I had to pull together from documentation on slack, PowerShell and azure.

Here is the script I finished with.


Dynamically setting IP to deploy assets to an Azure storage account behind a firewall from DevOps agents

If you try to deploy a static React app to an Azure static site on a storage account that’s behind a firewall you need to allow all the IPs that will be connecting to the storage.

The problem is that the range of possible IPs the devops agents use is huge and changes regularly.


Npm timeout when deploying Node.js app to azure app service using yarn

I was trying to deploying a Node.js app to azure app service recently but it kept timing out trying to download all the required modules.

I was able to fix this by specifying an explicit network timeout for the npm install in my azure-pipelines.yaml file


How I configure jest on a typescript Node.js application

Here is some of the jest configuration I have for a Node.js application in typescript that builds on a CI system.


How to also update the package.json version when using yarn update

If you run yarn update on a package, yarn will update the package and your yarn.lock file. This is totally fine. As long as you check in your lock file, your developers and team will all have the correct versions of libraries when they run yarn install.

However it will not update the package.json with the new semver for the package. I kind of found this annoying, if only for aesthetic reasons I wanted to quickly see which minimum versions of packages I was using in package.json.


Adding a junit formatter to jest test results for a Node.js app on Azure Pipelines

If you’re publishing a Node.js app on Azure pipelines you will want to publish the output of your tests. The publish tests task on Azure has limited format support so you have to convert the test results to XML for processing.


How to configure a pipeline on Azure Devops to build and deploy serverless graphql and react client

I need to automate deploys on Azure Devops for a project I’m working on. I want it to work as cheaply as possible so serverless or PaaS was desirable. Read on to see the azure-pipelines.yaml file I used to make this work.


How to fix "Incorrect integrity when fetching from the cache" error when using yarn

I’ve found this happens sometimes if I manually change the package config.

It’s a simple fix. You have to clean the cache.


Returning null from a GraphQL mutation in type-graphql

Null is not a GraphQL type so to return null from a GraphQL mutation you have to return a GraphQL type that is nullable. All GraphQL types are nullable by default so you can just return a bool in the schema but return void from the implementation.

It shouldn’t be too common to have a null response though, even for a mutation it could be better to return a state of the created item.


Typescript error "does not satisfy the constraint new" when using InstanceType in typegoose

If you get an error when trying to use InstanceType from typegoose as a parameter to a method in typescript make sure you are importing it from typegoose explicitly.

There is a thing called InstanceType defined in JavaScript already. Typescript will use this by default and that’s where the error is coming from.


How to find distinct items in an array in JavaScript or typescript

I have to sort a bunch of work items in to organisational areas so I needed to know what were the distinct categories of objects in an array. In C#/Linq there is a nice IEnumerable.Distinct(f(x)) method available but JavaScript doesn’t have something like this yet. I didn’t want to install a helper like lodash if I could avoid it. Luckily my list was simple strings so I was able to use ‘Set()‘.


How to await async functions in specific sequence using typescript

I was posting messages to a slack webhook recently and I wanted to post a list of messages in the correct order. I had to await each one before calling the next. I tried a few different methods but only one worked the way I expected it to.


How to log full objects in winston (hint... Use meta data)

I’m exploring the Azure Devops API at the moment and I find logging out the API responses is far better than trying to understand the documentation.

It seems super obvious now but it took me some messing around to figure out that you need to supply the object as meta data to the winston logger!


How to check bitwise mask in typescript

I’m currently building a little app that talks to the Azure Devops API and I had to check a bitwise operator in typescript today. I hardly ever do this these days so it took me a bit of time to get it right!


A gitignore file for Katalon projects

You need to add a gitignore file to your katalon directory or you will have lots of compiled files in your repository and it will be harder to compare changes in diffs when reviewing pull requests. Here is a suitable git ignore file for Katalon projects.


How to use session cookie authentication for Katalon API integration tests

This post describes automatically logging in to a webpage to get a session cookie and subsequently using the cookie for API authentication in Katalon. It shows how you can pass the cookie through a global variable to make authenticated API calls.


How to force a rebuild on Heroku without pushing using heroku-release-retry plugin

I had a deploy on Heroku fail because of a database issue. The code deployed but a dependency meant that the application couldn’t start. If you try to run git push heroku master you just get “Everything is up-to-date”.

My code didn’t need to change but I wanted the “deploy” to be re run WITHOUT pushing a new commit.


A retrospective on mentoring four new developers

Late last year I had the pleasure of helping a team of students build a prototype for a non-profit here in Auckland. The non-profit needed a prototype to raise more funds and get feedback on their plan.

I’ve helped run teams and mentor junior developers in large organisations. It’s much easier because the support, tools, frameworks, systems of the organisation are already available. For this project the student teams had a blank slate and had to decide on everything from how they would communicate with the sponsors to how they would host the software.

I wanted to write down what I learned and note some of the mistakes I made so that I have a framework for the next time I help new developers!


When Mocha doesn't run tests in subfolders on either windows or your CI server

I use a Windows PC for development and I had a problem where some of my mocha tests were not running on my CI server. The issue was that I use GitLab’s CI system which uses a Linux docker image to run the tests so the difference was the OS. This would also affect teams with developers on both Windows machines and Macs. Here’s how I fixed it…


Adding static JavaScript files to a react typescript project

I had to import a JavaScript in to my React project with typescript and typescript gave me an error. It wasn’t causing my build to fail but it was annoying seeing it in the console. Here’s how I got rid of the error.


Fixing Docker and docker-compose named pipes error (code2)

Docker on Windows 10 sometimes breaks after an upgrade. When you try to list containers or use docker-compose you’ll get an error on the command line. Here is an easy way to fix this issue.


Be careful of the JWT hype train

So many articles, courses and project “starters” on GitHub suggest using JSON Web Token (JWT) on your client facing API as a session token.

There’s way too much hype around JWT as a technology and it’s become a default for all authentication tokens instead of being used where it makes sense.


3 tips for starting and finishing side projects

Some of us like to make things for the web but everyone finds it super hard to find time to start and finish any side projects. If you’ve been thinking about something for a year but haven’t even started, here are some tips to help you start and finish more stuff!


How to add Bulma and PrismJs to a Gatsby project avoiding CSS conflicts

Bulma is a popular CSS library like bootstrap. It’s not too difficult to add to Gatsby but there are some tricky bits where you need some plugins and the CSS classes can conflict.


How to add cors protection to an express application

Cors protection is a recommended security configuration for any api. It protects your customers from unexpected attacks by blocking websites you haven’t approved.

If you have a devOps team they will handle this for you. But if you are a single maker with an application on Heroku and front end on Netlify you need to implement this yourself.


Converting a road bike into an electric bicycle

This is the guide I wish I had when I was researching how to convert a 2013 Giant Defy road bike in to an electric bicycle using a Bafang centre drive kit.


Fuzzy Friday

Hi, thanks for signing up to the newsletter.

Mary Meeker (Kleiner Perkins) has released the state of the internet report for 2018 - 294 pages of awesome . Personalised shopping and mobile advertising are growing like CRAZY!


Setting up a macbook for a windows developer

I recently got a macbook at work and I’m doing only web development these days so no Visual Studio. I had to do a bit of reading to get things set up and I don’t want to do it again so here is a post for me!


The Customer Workshop

I lead a team of developers that work on one of the busiest New Zealand websites. We have ~4 million members and ~850,000 unique users every day. Working at this kind of scale means the real people who buy and use our products can get lost behind user personas or Jira ticket numbers.


When agile gets dangerous

If you’re selling your teams on some form of agile but the reality they work in is completely different, you are damaging and demotivating your teams through confusion and an impossible to achieve vision. If you’ve adopted ‘agile’ do yourself a favour and check the health of the adoption right now.


Radical Candor in Practice

A.k.a. how to get the truth from your direct reports while you sit back and eat cake.

You’ve been a manager for a year and you’re not sure it’s all going OK? You don’t know if you’re providing maximum value to your team or which specific aspects of your people leadership to improve?


Saving your windows lock screen images

Here is a quick one. One of my colleagues was trying to figure out how to get the stunning windows lock screen images. They are hidden away in a folder on windows but this script will get them, rename them to .jpg and place them in a folder on your desktop.


Giving your first machine learning workshop

Last week I offered to give a workshop on machine learning to share some of what I’ve learned so far. I had 2 goals for my workshop – first, I wanted to show everyone that they shouldn’t be afraid of machine learning. Second, I wanted to get people set up with anaconda so they can continue to learn themselves.


Startup Weekend

Wow, it’s a week after Startup Weekend Auckland. I’ve had time to get my thoughts straight about the whole experience. I learned a hell of a lot of positive lessons about idea validation, about myself and about working in teams.


Cats and Dogs

Last week I had an amazing opportunity to present about machine learning and innovation to 110 people leaders at my company. It was a mixed audience of technical and non technical people.


Create-react-app react-router and Heroku

I’ve been putting together a React app and I needed cheap, fast hosting so I went to put it on Heroku.


Entering my first kaggle competition

Three weeks ago I discovered the fast.ai course. They offer a practical deep learning course for coders where you get straight in to building neural networks. They provide a huge amount of support through wikis, forums, aws scripts and tooling, videos and book recommendations.


Fuzzy Friday

From lunch to acquisition, how Atlassian bought Trello .

Success stories from developers who started at age 35,40,45 .


Webstock 2017 Part 1

Web Stock is tech conference like no other, held in Wellington, New Zealand. Once again I left feeling energized and impassioned after listening to all the speakers on such a wide range of subjects.


Webstock 2017 Part 2

Web Stock is tech conference like no other, held in Wellington, New Zealand. Once again I left feeling energized and impassioned after listening to all the speakers on such a wide range of subjects.


Fuzzy Friday

Seth Godin wants us to stop calling them soft-skills.

A beautiful photo story of Faberge and his eggs.


Smart Bear Ready API

I recently had a problem where our test analysts use Ready API software from Smart bear but our API authentication does a custom hashing function on the content. For tests to work we had to hash the entire request and apply headers for each test step.


Swagger UI: Custom HMAC hash authentication headers

Last year I launched a new API for an integration project. It’s using Microsoft’s WebApi framework. I was looking for a fast way to document the API so I wouldn’t have to do much work and clients could use the API easily. After some research it was obvious that I needed Swagger.