Software Development Articles

Convert a buffer to a string in Node.js

Buffers are powerful stuff. They make it easy to work with raw binary data, and streaming data can leverage them. Many third-party Node.js dependencies leverage buffers in one way or another, especially libraries dealing with data transport. So what the heck are we supposed to do with a Buffer when […]

Generating UUIDs with MySQL

Universally unique identifiers (UUID) are one of my favorite things. They are easy to generate, without collision, and they make it easy to expose an identifier to end users without it being so obviously guessable, like an automatically incrementing integer value. While they are fantastic, the ability to generate one […]

Using variables in MySQL queries

Variables. One of the cornerstones of most, if not all, programming languages. They save you time by not having to type the same crap over and over. They can be manipulated for your own gain. They can even be used in your MySQL queries. The declaration syntax for variables in […]

Incrementing and decrementing numbers in Vim

I live on the command-line, and a huge chunk of that time is spent in Vim. Well, Neovim, actually. I do everything from writing code, to writing for my blog, as well as other prose that I have in the works. One thing that comes up pretty regularly, thanks to […]

Showing differences of staged files with git

Something I don’t like about git, primarily because it doesn’t fit into my personal development workflow, is how git diff only applies to files that have not been staged to commit. Sure, it makes sense if you are the type to stage files locally on a regular basis without pushing […]

Using paths to create hierarchies in Parameter Store

Parameter Store only supports a limited number of character for the parameter name. As per the error message you’re presented with, Only a mix of letters, numbers and the following 3 symbols .-_ are allowed. What that error fails to mention is that you can actually use a fourth symbol, […]

Getting String and SecureString Parameter Store parameters with Node.js

Parameter Store has slowly become one of my favorite things about AWS. It makes it easy to share things between ECS tasks and services, and Lambdas. The parameters can be references inside of a CodeBuild buildspec file, and it’s all language agnostic, which is handy if you are running different […]

husky: command not found with npm install --production

Recently, while attempting to build a Docker container, I ran into a bit of a dilemma. Upon running npm install --production I was greeted with this less than ideal error message: > @company/[email protected] prepare > husky install sh: husky: command not found Well of course husky isn’t installed, as it’s […]

Decrypting SecureString Parameter Store parameters with Node.js

Parameter Store, part of AWS Systems Manager gives you a quick and easy way to store parameters that you’d like to use in your applications. By selecting the SecureString type, you get the added bonus of encryption for you most secret parameters. By default, when you fetch a SecureString type […]

Add column after another column in MySQL

By default, new columns are added to the end of a table in MySQL. This works well most of the time, but sometimes when you’re retrofitting a column into a table, you may want it to be adjacent columns closer to the start of the table. The ALTER statement makes […]

Docker Desktop won't reopen on macOS

After months of waiting, I finally received the MacBook Pro that I had ordered back in February. Thus far, it’s been a solid machine with crazy battery life, but not without it’s quirks. One recent quirk was with Docker Desktop. I had the app open and I quit it instead […]

How to convert JSON to CSV in JavaScript

Last week we discussed converting CSV to JSON in JavaScript. This week, we’re going to talk about going in the opposite direction, converting JSON back to CSV. Similar to last week, we’re going to use the immensely popular papaparse library. As it turns out, even though it’s touted as the […]

How to convert CSV to JSON in JavaScript

Parsing CSV data isn’t as easy as splitting the string up into individual lines, then splitting it by the delimited (in this case commas). Some of the values may have quotes around them, sometimes the values themselves have line breaks. Then there’s the potential that the data itself is malformed. […]

Tracking daily active users (DAU) with Redis

Daily active users, also known as DAU, is the number of unique users that have interacted with a website or application in a given day. We’re going to discuss how to track this metric, in a language agnostic fashion. The concepts discussed and Redis commands utilized can be implemented in […]

How to display a JavaScript array in HTML

From time to time, I see a search query that made it to my blog that piques my interest and inspires a post. This is one such post. How does one take an array (presumably in JavaScript) and display it in HTML? Now in this day in age, I would […]

Splitting strings and keeping the separator in JavaScript

When splitting strings, the majority of the time, I don’t care about the separator (or delimiter), just the strings that exist between it. In JavaScript, that’s very simply with .split(): 'one,two,three,four,five'.split(','); Which will yield an array of strings like this: ['one', 'two', 'three', 'four', 'five'] Great! But if we want […]

Downloading files in Node.js with Axios

I’ved used Axios a ton, but I’ve only ever used it to make AJAX requests. In fact, I don’t ever remember a time when I’ve needed to download a file and save it to disk in Node.js. That changed recently with a new side gig I’ve been helping out with. […]

Best way to pin TypeScript as a dependency

While I’m a pretty big fan of TypeScript, there’s some stuff that drives me up a wall. One of those things recently came to light during the release of TypeScript 4.4 on a Friday afternoon. So it was nearing both end of day and end of week, and we were […]

Remove unnecessary files in node_modules

As the meme goes, the object with the largest mass in our universe is the node_modules directory. Generally speaking, storage is cheap, and while an unkept set of dependencies can be quite messy (and often times a security hazard), the size of your node_modules directory tends to not be of […]

Debugging an AWS Lambda that stopped working

My wife and seed would agree that talking about AWS Lambdas are in my “big three” of things to not shut up about, along with fishing and professional wrestling. Regardless, I do love them so (both the Lambdas and the fam bam). As I’ve grown to use them more and […]

Setting an authorization header when using file_get_contents with PHP

Going through some of my old lists of blog post ideas this weekend. While it’s not something I’ve needed for a minute, it’s still something worth taking about. How to set an authorization header when using PHP’s wonderful file_get_contents() method. Similar to an old post of mine talking about specifying […]

Find unused npm dependencies

As much as I love to sling code, I love that we live in a world where you can stand on the shoulders of giants and easily leverage other people’s hard work by way of Open Source libraries. Simply referred to as “dependencies”, these little code gems can save a […]

Repeating Strings in JavaScript

While cleaning up some of my old notes today, specifically stuff I jotted down that would make for a good blog topic, I happened upon the topic of repeating strings in JavaScript. Things are really easy in ES6+, but if you happen to still support Internet Explorer for some crazy […]

Uninstalling dev dependencies with npm

While looking into some deployment issues recently, I ran into some logic that was in dire need of being refactored. The logic in the build process was installing all dependencies with npm, then removing the node_modules directory, just to install the production dependencies again. Yes, you read that right, the […]

Overengineering Challenge: Is Number Even or Odd in JavaScript

Code golfing is fun, and makes for great blog posts. The problem is, the world is flooded with posts attempting to show you how to write the best / most concise code imaginable. With that, I decided that it would be a fun challenge to attempt to take a simple […]