March 2022

Chrome devtools: Using logpoints for logging messages directly

Chrome devtools: Using logpoints for logging messages directly

  • March 24, 2022

When it comes to debugging JavaScript in Chrome devtools, there are two different camps: the console.log fans and the debugger/breakpoint maximalist. I often switch between the two depending on what problem I am tackling. There is a third option that is kind of in the middle. Logpoints provide us with...

How to prevent npm install for unsupported Node.js versions

How to prevent npm install for unsupported Node.js versions

  • March 17, 2022

npm configurations allow us to do quite a lot of nifty things. One of them is to allow the project to set the Node.js version that needs to be used in order to run the project. This also provides us with the functionality to prevent npm install for unsupported Node.js...

How to kill a process on a port using the command line

How to kill a process on a port using the command line

  • March 10, 2022

Zombie processes are usually a pain to figure out. More often than not, I end up googling about how to kill a process on a port using the command line. It can be done using the activity monitor as well, but that is a time-consuming process. There are ways of...

Detecting dark mode preference using JavaScript

Detecting dark mode preference using JavaScript

  • March 2, 2022

As dark themes have become popular across the web and across operating systems, we might want to check the user’s operating system preference when they visit our website. This way, we can initialize our website accordingly after detecting their dark mode preference. We can make use of the prefers-color-scheme media...