Writing readable CoffeeScript

Hello! At the time this article was written, CoffeeScript was a great alternative to vanilla JS and I would have wholeheartedly recommended it for new projects. Since then, most of the cool stuff from CoffeeScript (plus a lot more) has been brought into mainline JS with ES6 and ES7. If… »

Brute-forcing a simple hash (Python)

I came across this problem online: Find a 9 letter string of characters that contains only letters from {acdegilmnoprstuw} such that the hash(the_string) is 945924806726376. You're given a hashing function, which I translated to Python as follows: def hsh(s): h = 7 letters = "acdegilmnoprstuw" for i, val in… »

Solving T9 Autocomplete with a Prefix Tree

If you ever had a flip phone, you probably used T9 to compose text messages. T9 let you enter words with a single tap on each number key, instead of selecting each letter with multiple presses (otherwise to get 'c', you'd need to hit '2' three times). It looked at… »

Dynamic Programming Illustrated – Minimum Path

This is the algorithm that helped me understand dynamic programming. In the problem, you're given a grid of numbers: Starting in the top row, you select a number, and add it to a running total. You look at the next row down, and pick the number either diagonal left, straight… »

Intro to Neo4j and Cypher

This is a quick intro to the Neo4j graph database and its Cypher query language, based on a talk I gave at Hack Reactor a few days ago. By the end of this post, you'll have a general idea of how to read Cypher, you'll have a starting point for… »

Chrome’s Console API: Greatest Hits

Update 4/3: Someone was nice enough to post this on Hacker News, so there's some further discussion at https://news.ycombinator.com/item?id=9314185 for those interested. The Chrome debugger is the best tool for locating problematic code in a JavaScript application, but there are times that diving… »