Page 2 of Software Development Articles

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 […]

Symlinks with Nginx and PHP-FPM

Recently I’ve been putting time into rebuilding the server infrastructure for Holiday API. This has included hardening the system to be more fault tolerant and building out a new cluster of web servers. The biggest improvement was [finally] introducing a continuous deployment pipeline to complement the existing continuous integration flow. […]

How to exit Vim

I’m sick and fucking tired of being asked if the reason that I use vim (currently using nvim) is because I can’t figure out how to exit. I get it, you saw some stupid shit on Stack Overflow and you think everybody that uses vim is incapable of knowing how […]

Explaining vs. Communicating

This isn’t a post about mansplaining or anything like that. I’m simply taking about explaining things instead of communicating them. In regard to project management, explanations tend to be a reactive act. Explanations are a way to justify why a project is behind. You could easily swap “explanations” for “excuses” […]

Solo developers should still do code reviews

As a single developer on a handful of projects, I’m a huge proponent for establishing systems and best practices, even if they don’t seem practical as an army of one. In the past I’ve written about making sure version control is in place even if you’re the only developer on […]

Why would they do it that way?

I’ve been a professional software engineer for just shy of half of my life. Along the way I’ve had the opportunity to work with a ton of different people and personalities. A common theme with most developers is that they really like to do things their way. This tends to […]

Posting code snippets to Slack

A buddy of mine recently asked me how to post code to Slack and make it look good. It wasn’t the first time this has come up either. Different folks have asked, not like the same person keeps bugging me about it :P Trying to explain things to him reminded […]

The most efficient way to check the last character of a string with JavaScript

Recently I was writing some code that needed to detect if a certain character was at the end of the string to determine if some additional logic should be executed. The reason for this was because the additional logic to run was pretty hefty and for pre-mature optimization’s sake, I […]

How to check if a string contains another string with JavaScript

Checking whether or not a string contains another string, or just a single character. It’s a been a pretty unavoidable sanity check in my programming career. It’s not quite a problem for the ages, but it comes up regularly and can be approached a few different ways. ES5 and prior […]

Left align multiple line list items

I don’t claim to know all the things, and this post is definitely something that I’m pretty sure nearly everybody on the planet knew about but me. The problem I was attempting to solve recently is that I had a list and the left alignment of the multiple lined list […]

Will Vim die with Bram Moolenaar?

I really, really really want to love nvim. Yet another go with it this past week and I’m still not convinced it’s ready for me. With that, I do agree that it’s the future of vim. Development still seems to be moving quickly and in the right direction, but as […]

FizzBuzz in TypeScript 3.0

FizzBuzz, the engineering smoke test that quickly reveals if somebody is drastically under qualified in their development abilities. Even if you’re unfamiliar with the exercise, most are able to make short work of it. It only leverages a small handful of programming concepts that even the most novice developer should […]

How to calculate United States holiday observances

Usually around a holiday I will do a post that’s somehow related to the holiday. Seemed kind of silly to do a post on how to calculate Independence Day in the United States since it’s pretty straight forward. It always lands on the 4th day of the month of July. […]

Stop blaming your hosting company for downtime

I was struck with downtime last week. Linode’s Fremont data center went offline in a big way. Service was interrupted for nearly 4 hours. Did I panic? OF COURSE I DID! At first at least. Thing is, when a site of mine goes down, I just assume that I had […]

Unique indexes with MongoDB and Mongoose

Even though I’ve been using MongoDB for the last few years, I’m still very much a noob when it comes to a lot of things. One of those things would be unique indexes. Generally speak, I interact with MongoDB three different ways: I write code that explicitly creates something with […]

How to POST to a webhook in 5 different programming languages

With the release of inbound webhooks for CrowdSync workflows last week, it seemed fitting to do a write up on how to POST to a webhook. So what is a webhook, anyway? The Wikipedia definition is that webhooks are “used-defined HTTP callbacks”. Kind of a stuffy definition if you ask […]

Chunking an array in JavaScript

Recently I was working with some data coming out of a Redis pipeline and I wanted to take the data and split it up into an array of X items per key. I was working with PHP, this wouldn’t have been a big deal, just use array_chunk and get on […]

How to !important inline styles in React

If you’ve ever used Bootstrap, you probably know that it’s pretty aggressive in it’s use of !important in it’s styles. At CrowdSync we love Bootstrap, having ditched Foundation for it, but the overzealous approach to !important does get in our way sometimes. Similar to our post earlier in the week, […]

Using <style /> blocks in React

Every once in a while you are faced with a scenario where the best course of action is to slap a &lt;style /&gt; block in the middle of your code. For us, it was that time we wanted to set an arbitrary width (selected by the user) on a component, […]

URL routing in PHP

The other day I was checking out what folks are querying to get to my site. Of course a ton of people get here looking for VPS comparison, but what surprised me was the volume of queries for “PHP routing”. Back in 2015 I had posted a basic page rounding […]

PHPUnit with multiple versions of PHP and HHVM on Travis CI

Recently I was updating my PHP Lorem Ipsum library in an attempt to get it testing on HHVM on Travis CI alongside the other versions of PHP I was testing against. Incidentally, the last time I had worked on the project, I had to work out some kinks with older […]

Days until Christmas in JavaScript

Time again for one of my holiday cop out posts :) Here’s a couple of ways to calculate the number of days until Christmas: Vanilla JavaScript Math.floor((+new Date('2018-12-25') - +new Date()) / 86400000) Using momentjs moment('2018-12-25').diff(moment(), 'days') Merry Christmas! […]

Adding comments to JSON

From time to time I’ve wanted to be able to comment out lines in a JSON file. This typically comes up when I’m making a butt load of changes to package.json and I want to keep a visual history as I’m tweaking things. Just last week, it came up with […]