Menu

Using React with Babel and Webpack Hot Module Replacement Middleware

If you're developing a web application using React and ES6/ES2015, you may have cursed at the computer or impatiently tapped your fingers while waiting for files to compile and then having to manually reload the browser to see the latest changes. I used to use Gulp to help streamline…

ES6 Promises: Best Practices

After using more and more promises lately, I've gathered a handful of good and bad design patterns for promises. I'm going to list out some examples of how promises are typically used and demonstrate anti-patterns and how to clean them up. Like everyone, I've been guilty to some of these…

String Compression and Concatenation Performance

Here is a whiteboarding problem that may come up in interviews. You are given a string. Implement a function to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the "compressed" string would not become smaller than the original string,…

Tree Traversal

BFS vs. DFS When you need to search or traverse a graph or tree-like structure, there are two common algorithms: breadth-first search and depth-first search. Which algorithm to use really depends on the structure of the tree and the location of the items you need to find. Here are some…

Locally Test Pull Requests

In this post, I am going to cover how to easily test pull requests on your local machine. When you work in a team where people are submitting pull requests, you want to make sure their changes are free of bugs and do not break any existing code in the…