Category: Software Development
-
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,…