Category: Software Development
-
Stop ESLint from searching up the directory tree
For most projects, I use a monorepo, and nest my scripts in a directory. I’ll npm init each script, and maintain an isolated set of dependencies outside of the main dependency tree. This includes maintaining a separate .eslintrc file as well. Typically, this isn’t a problem, but recently with a new project that was created…
-
Airbnb style guide with Next.js
Starting a fresh Next.js project the other day, I was happy to see that configuring eslint was part of the bootstrapping process. Where things fell short for me, was the lack of a prompt asking me which style guide I’d like to use. I’m sure the out of the box option is sufficient enough, and…
-
Mocha tests hang after tests have finished
Recently, while revisiting a Node.js repository I haven’t contributed to in ages, I encountered a new problem: the Mocha tests would hang instead of exiting. When I asked about the error, it seems it was recently introduced and nobody had pursued tracking down the root cause of the issue. Conveniently, this issue was only happening…
-
How to generate a JSON compile commands database with CMake
Generating a compile_commands.json file, a JSON database of compile commands, using CMake isn’t something I run into as a web developer. But as somebody that’s recently gotten bitten by the game development bug, this was one of the first things I happened to have run into. I’m not going to bore you too much with…
-
Moving to WordPress from Jekyll
I recently told some friends that I was moving to WordPress from Jekyll. Not a surprise, the overwhelming sentiment was that hell had in fact frozen over. If you’ve followed my blog, you may remember that I’ve bounced around between WordPress and Jekyll a few times. I’ve also jumped around between GitHub, GitLab, and Cloudflare’s…
-
How to overwrite read-only files with vim
We can file this post into the category of “stuff I’ve known how to do for a long time, but I was shocked I hadn’t put out a post discussing it before”. If you use Vim or Neovim as much as I do, you end up touching a lot of…
-
How to disable the X-Mailer header with PHPMailer
Sometimes things aren’t quite as you’d expect them to be. One such case is when you try to disable the X-Mailer header with the PHPMailer library. The library itself is pretty straight forward, you instantiate the class, and then you can interact with headers as object properties as such: $mailer…
-
Filtering WordPress menu items
Recently I had a request come in to update the navigation on a WordPress site. The way the request was worded made me think the change to the menu needed to happen on one specific page, and not across the entire site. This created an interesting problem, as the theme…
-
Time zone conversion with PHP
I do not like time zones. They’ve been a fairly regular pain point in my career, especially early on. There was even a time when I built something and totally forgot that time zones existed and well, it was a mess. For the most part, time zones don’t cause me…
-
Schedule queries with MySQL
While researching the most performant way to delete a high volume of rows in MySQL, I happened upon some syntax that I had never heard of before. This syntax allows you to run a query on a schedule, without the need of any external code. As a rule of thumb,…