Blog posts

How (and why) you should tag subscribers to your tech blog

Let’s be real: most developers decide what to blog about on a whim. Our blogs cover tons of topics, and there’s a good chance that the only person interested in ALL of them is, well, us. That’s just one reason it’s handy to tag and segment subscribers to your email list. Basically this means assigning tags to people based on what blog post made them decide to subscribe. You can use tags and segments to:
Read more

How to update a pull request from a fork with Git

If you maintain an open-source project, there’s a good chance the pull requests you receive need a little bit of work before they’re ready to merge. Here’s a quick step-by-step guide for how to modify commits on a pull request when it’s coming from a fork of your repo. In this guide, we’ll assume the following: Your repo: github.com/your-username/your-repo-name Your contributor: their-username Their PR’s branch: bugfix-branch Step 1.
Read more

My first npm package: A Gatsby theme for knowledge bases

After dragging myself out of what I’m dubbing the quarantine slump (namely, playing 100+ hours of Animal Crossing, re-watching Children of Men, and concluding that I’m probably not inside a simulation), I finally published @mlent/gatsby-theme-help-center. It’s the first time I’ve published my own npm package, not connected to work! Well, it’s kind of connected to work because I built this theme because I needed it for my own SaaS product.
Read more

7 software developer resume tips to help you stand out

I’ve read thousands of resumes and CVs during my 3+ years as a hiring manager at a high-growth tech startup. It’s the same at many companies: Most applications land in the bin at the stage where your resume or CV is all the company knows about you. The reason for this is more or less mathematical: It’s simply impossible to speak to every single applicant. The time of hiring managers, tech recruiters, and everyone involved in any given hiring process is finite.
Read more

7 absolute truths I unlearned as junior developer

Next year, I’ll be entering my 10th year of being formally employed to write code. Ten years! And besides actual employment, for nearly 2⁄3 of my life, I’ve been building things on the web. I can barely remember a time in my life where I didn’t know HTML, which is kind of weird when you think about it. Some kids learn to play an instrument or dance ballet, but instead I was creating magical worlds with code in my childhood bedroom.
Read more

Management books developers should read, too

I’ve grown a lot over the last year at my job. Things are never really the same for long, and I’ve had a ton of different challenges to tackle – both on the technical side, but in a growing proportion on the side of people management and technical leadership, too. So I wanted to share some of the books I’ve loved over the last year, which I would recommend even to developers who aren’t currently managing people or projects.
Read more

Responsive Images With Nginx on Ubuntu

I started looking into this topic because, as you’ve probably heard, Google changed its pagespeed insights tool (and search ranking algorithm) to focus on mobile-first. I’ve got an image-heavy blog that does pretty well in Google, but my pagespeed score was somewhere between 75 and 80. One of Google’s biggest complaints to me were that my images were not resized properly. The only problem is I have hundreds of images on that blog, and there was no way on earth I was going to actually create mobile-friendly versions of every single image.
Read more

8 excellent technical talks that'll change how you think

It’s not that often that I go to a conference or watch a talk on YouTube that truly changes the way I think about programming or software development. Even though I’m someone who does frontend development for a living, most of the talks that were most illuminating for me are technical talks that are either language-agnostic or unrelated to my daily work. Here are a few of the best talks I’ve ever seen on programming or the field of technology (in no specific order!
Read more

Deploy static sites to Digital Ocean with Travis CI

This blog is written with Hugo, a static site generator written in Go. I also have a second blog that uses Hugo as well - and while I love the speed and simplicity of this system, it’s still a pain to deploy by ssh-ing into my remote machine, pull updates, and build manually. Even when I can authenticate via YubiKey ;) So over the Christmas holiday, I automated the deployment of this blog whenever I push to the master branch.
Read more

Set up 2FA on Ubuntu with YubiKeys

What’s a YubiKey? A YubiKey is basically a tiny device that plugs into your USB slot and pretends to be a keyboard. When you tap the little golden disc, it types out a One Time Password (OTP). Through the Yubico API, you can easily validate this password, and use it in combination with another method of authentication (such as a password or ssh key) to achieve two-factor authentication (2FA). Many popular websites like Google, Facebook, and Github allow you to enable 2FA via YubiKeys.
Read more

Writing Haskell with Vim

Getting started writing any new language is easier with the help of your editor. In the case of linters, they can teach you the language’s idioms and best practices while you write your first lines of code. Here’s how to set up a new project in Haskell and configure vim for Haskell. Basic vim setup for Haskell What you’re going to need: Vim 8 Your .vimrc A vim package manager (here I use vundle) Airline (Vim status bar) ALE (Linting engine) ghcmod-vim (Reveal types inline) Haskell / ghc Stack ghc-mod, hlint, hdevtools, hfmt This tutorial assumes you already have Vim 8 installed.
Read more

How to manage or eliminate React state without Redux

When I started writing React – I made a big mess. Many of my components took too many props, or my component had an immense amount of state. Doing simple things required a lot of data manipulation, and ultimately led to a lot of bugs. It didn’t take long for simple tasks to become extremely tedious. I think this happens to a lot of people who start out with React.
Read more

Converting an Angular.js app from Require.js to Webpack

I’ve recently converted my webapp at work from Require.js to webpack, and although the initial setup was a little tricky, it clearly offers numerous benefits to make the switch when it comes to performance, loading times, and development workflow. In this post, I will only cover a basic switch from Require.js to Webpack. In a following post, I’ll go into lazy-loading with webpack and ui-router. Possible Require.js setups, and their pitfalls In essence, there are two basic setups you can have for your Require.
Read more

Karma tests with AngularJS + RequireJS

Setting up testing is usually a little painful – but setting up testing when you’re using some kind of weird Angular + Require setup is even worse! Furthermore, the Karma documentation is a little bit terse, so it’s hard to tell exactly what combination of configuration settings will get you your intended result. Here’s how I accomplished this. File Hierarchy Here is a typical, sample hierarchy. My top-level directory is something like /opt/some-app.
Read more

Django Tastypie: Tips, Tricks, and Troubleshooting

Tastypie is one of the most popular REST API frameworks for Django, and surprisingly easy to get up and running if you’re already working with Django’s Models. It can, however, be a bit difficult to debug, and produce some cryptic error messages. Here are a couple of tasks I’ve had to figure out while working with this framework, tips for troubleshooting, and some general reflections. Table of Contents Adding Fields to a Resource Mapping Attributes of an Object through a Reverse Relationship Filtering via Through Relationships Self-Referential Resources Adding Fields to a Resource It seems simple enough – and it is – but there are really a number of ways to do it, so you have to decide which is most appropriate for your use case.
Read more

Internationalization with Django, Backbone, Underscore templates, and Sass (LTR and RTL languages)

Let’s be honest: No developer wakes up in the morning and thinks, “Oh goody! Today I get to internationalize my giant website with tons of content and files. I bet supporting right-to-left languages is going to be a blast.” However, I’m here to tell you that it’s not nearly as bad as you would expect. In fact, Django makes it downright easy to do. Unfortunately, there’s not a lot of information on the web about internationalizing (also known as i18n) in Django besides the official documentation.
Read more

Building a Parse Tree Editor in d3 with Tree Layout (Pt. 1 - Display)

“In this way, the Athenians came to the circumstances under which they grew in power.” The first sentence from Thucydides’ Pentecontaetia. This is a long post and chances are you only need information from part of it. Here’s a table of contents: Background Trees: In Linguistics and in d3 Our Incoming Data Dependencies Base Code Our HTML Our Main for Require.js Our JS Base Key Functions Initialize Module Convert Data Render SVG canvas Update Tree to Use our Data External Resources
Read more

Install Node.js on Debian Squeeze

I had some issues with libraries installed via npm (such as d3 and jsdom) causing segmentation faults in Mocha tests. Ultimately I realized that it wasn’t a problem with these node modules so much as it was with my node install itself. I had installed from source following this guide, but it wasn’t quit enough to get my node install right on Debian Squeeze. Install Node.js Dependencies Pretty standard stuff – make sure you’re up to date on these.
Read more

Set up Nginx and uWSGI

When browsing the web, I often read that setting up nginx with uWSGI is incredibly easy to set up and get running. I absolutely did not find it so, as I had to deal with a lot of configuration issues. So here’s how I finally got these components working together on an instance of Ubuntu 12.04. I ultimately hook this up to Django, but I’m sure the general principle would apply to other python frameworks with a WSGI interface.
Read more

Custom event for detecting fetch errors in Backbone.js

One of Backbone’s major strengths as a javascript MVC framework is the way it helps you do event handling. By extension, it’s also great for handling errors that result from failed AJAX calls. As you can see in the Backbone.js documentation, the error event is triggered when a model’s attempt to save fails server-side. However, there is no Backbone event that detects when the fetch event fails. Since a fetch from the server is the first thing that happens when a page is loaded, you would need to know if it fails because that could indicate that the API is down or some other server error.
Read more

Quick Tip: Use jQuery to Complete an Arbitrary Number of AJAX Calls Before Firing an Event

Somewhat recently, I encountered an issue where my expected user input is an arbitrarily long list of words. While I could get the word count, I had no reliable way to know whether all of the ajax requests had been completed before firing an event that created a list of definitions for each word. I had several realizations in my quest: I could do the entire process synchronously. However, this meant that one bad ajax return or error could cause the entire process to hang.
Read more

Avoiding the OOM Killer by limiting the number of Apache2 processes and clients

Prologue Last week I had the following mortifying experience: I tried to ssh into my box hosted at RackSpace and nothing happened. It simply hung, and never prompted me for my password. Commence panic. I determined that port 22 was, in fact, open, and I was connecting to the machine at some point. nc -zw3 monicalent.com 22 Connection to monicalent.com 22 port [tcp/ssh] succeeded! telnet monicalent.
Read more