Page 2 of Software Development Articles

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

Configuring Jest to show code coverage for all of your files

Jest is a great tool. It’s fast, actively maintained and has been working well for us with both our front-end and back-end systems. Simply put, Jest helps us make CrowdSync better and more stable. Out of the box though, code coverage is only shown for the files that you’ve written […]

Setting defaults for all your SuperAgent requests

SuperAgent is an HTTP request library for both Node.js and client-side JavaScript. It’s our current choice here at CrowdSync for making requests because it’s lightweight and easy to use. Unfortunately, out of the box, it doesn’t support setting defaults on all of your requests. The simplest approach would be to […]

Simple cache busting with Webpack

Here at CrowdSync, we’re huge fans of CloudFlare. As customers, we are leveraging the power of CloudFlare’s caching mechanisms. Part of our deployment process to production involving flushing the cache via the CloudFlare API. Problem there is that only solves half of the caching dilemma. Even with our CloudFlare cache […]

Stop over configuring Vim

Over the year, I’ve waxed and waned with the size of my .vimrc. In the early days, it was trim but so was my knowledge of Vim. Once I learned how to disable my arrow keys, I started to configure more and more. It wasn’t until I fully understood the […]