Category: Software Development
-
Submit on enter except when shift is pressed in JavaScript
Been working on something recently where I wanted to implement a submit handler when a user hits the enter key in an input. That’s not that big of a deal, sniff out the key being pressed, and if it’s the Enter key, go ahead and execute the submit handler. Since…
-
Detecting modifier keys being pressed with JavaScript
Been hot on a new [old] project recently and I’ve not only been coding my ass off, but delving into some territory that I haven’t delved into as of late. The latest is in terms of determining if a modifier key has been pressed in conjunction with another key press….
-
Protected routes with React Router v5
React Router makes it extremely easy to define routing in your React application, but out of the box doesn’t concern itself with which routes should require authentication and which ones should now. I’ve solved this problem in a past life, using React Router v4 and looking back at the code…
-
Connection reset with webpack-dev-server inside Docker
After a very brief foray into using create-react-app, razzle and next.js recently, I decided that this old dog still prefers to go it alone and just build things out without the aid of frameworks and boilerplates. With that, I was quickly reminded of an issue that I’ve run into in…
-
Complete CI/CD pipeline with GitLab Runners
Automation is one of the best ways to improve productivity. Even as a development team of one, spending a bit of time on DevOps and improving your developer quality of life can pay off immensely. Automated tasks strip away cognitive load. No more forgetting to deploy code because the process…
-
Converting integers to Roman numerals with TypeScript
My buddy Robert has been seeking new opportunities in the software development realm, and recently ran into a coding challenge that I haven’t thought about in a good long time: converting an integer to Roman numeral. Now, I actually hate these kinds of brain teasers in the context of interviewing…
-
Padding strings and numbers with JavaScript
Programming languages can change pretty regularly, and I try to carve out some time periodically to catch up on the latest and greatest the languages I love have to offer. With that, recently I was poking around on JavaScript’s string prototype and came to realize that there were some string…
-
How to remove an array element by index in JavaScript
Recently I was faced with the need to remove an item from an array, by index in JavaScript and I came to realize it had been quite a while since I had to do something like that. My initial, and extremely incorrect thought was that I could just use delete…
-
How to loop through all files in an S3 bucket in PHP
Recently I decided to finally tackle the ever growing S3 bucket for the niche social network I run. The reason it’s ever growing is because I never implemented any sort of hard deletion logic. At one point, I was planning to move the images over to soft deletions, but never…
-
Could not find a declaration file for module
I’ve been working with Typescript on a daily basis for the last year. Admittedly, I still feel pretty amateurish with it. Mostly due to the fact that I’ve mostly been working with it on an existing stack at work and minor application of it on my own side projects. With…