Hosting a Node.js process on a non-default port on AWS Elastic Beanstalk

Two things happen that make it difficult to run a Node.js process on a non-default port. First, Elastic Beanstalk uses load balancers. When a request hits your EB DNS (your-app.elasticbeanstalk.com) the load balancer directs the traffic to the least utilized instance (assuming you have multiple ec2 instances…

Overriding the 'verify' method on MiniTest::Mock

Ran into an interesting problem today in which a method in one of my classes happened to have the same name as a method on my testing framework. I'm pasting a lot of code but highlighting the important details with comments. Contract require_relative './exceptions' require_relative './fulfillment_…

'New' Keyword in JavaScript

The new operator is often misunderstood and improperly used by programmers just learning JavaScript. This operator "creates an instance of a user-defined object type or of one of the built-in object types that has a constructor function". Let's focus on one part a a time. In the sentence…

How to check out a GitHub pull request locally

A common git workflow is for developers to work on a feature branch of their local fork and then submit a pull request to the upstream master. The pull request is then reviewed by other members of the team and if everything looks good it's merged in. For simple pull…

Browser extensions to add tab in textarea

Here's a little productivity tip if you do a lot of in-browser text editing. If you ever get annoyed that the tab key moves your cursor to the next form field when you are editing a text-area in a browser, download this Chrome extension. https://chrome.google.com/webstore/detail/…

Bash profile tips and tricks

Check out this XKCD comic and think about what repetitive tasks you could shave seconds off of throughout your day. Props go out to Josh Wyatt for showing me the world of .bash_profile time-saving techniques. The first thing to do is make it convenient to add new shortcuts to…

Docker Workflow from Development to Production - Part 2

Now that we know what Docker is and have it installed, let's look at how we can use it to deploy an app. We are working on a project now as part of HackReactor's curriculum. Our project involves a MySQL database and ExpressJS API on the back-end handling basic CRUD…