Use Leaflet.js to create custom maps While looking for a solution to display a map embedded into a web page, I came across several options. My initial idea was to use something like Google Maps or
Python Cheat Sheet I've been using Python after a dry spell of using other languages. I went through the basic mechanics of the language and tried to use a wide variety of different
Convert CSV to KML/KMZ using Google Maps In my last post, I was bulk gathering GPS coordinates from the internet. After I had them, I still needed a method to display them. Luckily, Google My Maps offers
nodejs Scraping Wikipedia with NightmareJS I've written a lot of webscrapers in the past. Each approach I've used has its benefits and drawbacks. If I need to be able to do anything more complicated than
nginx Nginx redirects using Lua For years, I've been a big fan of DuckDuckGo's bang feature. I use it any time I have a specific site I want to search. For example, if I know
javascript Set content of a frame with HTML string I ran into a problem when I was trying to display an HTML page hosted on Github. Since Github serves HTML files as raw text in the content type headers,
C++ UUID Generation in C++11 The C++ standard libary has come a long way in the last ten years. It contains a lot of useful functions that make stuff easy that used to be a
Formatting JSON without external libraries Most programming languages today have great JSON support. If it isn't built into the language, there is a de facto standard library you can add to your project. Included in
Convert a class of static fields to a dictionary in C# I was coding in a C# project when I came across a class that was mapping names to GUIDs. Since GUIDs are objects, you can't simply put them in a
python Use Python's xmltodict to convert XML to JSON I found myself recently having to deal with a large and complex XML document. I wanted to use Python's excellent paradigms like generators and list comprehension to carve up the
Use System.Xml.XmlDocument to create HTML in C# If you need to create HTML, it is usually a bad idea to just concatenate strings together. It tends to create brittle and invalid documents once there is any level
Use Ghost's API to retrieve posts This blog is running Ghost, a relatively new blogging platform developed with NodeJS. It seemed like a perfect match for this website when I was first starting off because I
Scraping a book from Kindle (read.amazon.com) After writing my latest post on scraping text from Amazon's web Kindle reader, I got an idea. I wondered how hard it would be to scrape an entire book with
Copy text from Kindle e-books (read.amazon.com) I recently bought an e-book on Amazon. It had been a while since I had last done it, so I was surprised to see they had an online viewer for
Implementing Java's String.hashCode in JavaScript I recently needed a simple way to keep track of if I had seen a particular string before. A naive way to approach this would have been simply to keep
Upload files as multipart with HTML 5 and Angular 1.6 I recently came across a well designed add-on to upload files with Angular called angular-file-upload. It's highly customizable, takes full advantage of the HTML 5 file drag and drop, progress,
Create PDFs with HTML using wkhtmltopdf and Node Creating PDFs is a deceptively simple problem. It seems like a well defined problem. It's a ubiquitous format and they are static. We use PDFs every day and know how
Resizing SVGs in HTML with correct scaling When I was trying to resize some SVG images to better fit onto a PDF, I thought it would be as simple as resizing a <img> tag: simply
Exploring Knuth's multiplicative hash While researching some cryptography methods, I stumbled upon Knuth's multiplicative hash method. I was surprised how well it worked for how simple it is. It's not perfect but it is
Getting all paths of an JavaScript object I recently came across a problem where I needed to iterate through a JavaScript object and apply an operation to another object with the same structure. The best way I've
Creating responsive tables with flexbox One of the most promising developments in CSS recently has been the flexbox display option. Ever since bootstrap hit the scene, grid layout platforms have all but superseded the old
Test if a string is alphanumeric in JavaScript It's fairly easy to test if a string contains any alphanumeric characters with regular expressions. However, they aren't functions. They can't be passed as arguments to map, filter, reduce, and
Create an object by path in JavaScript If you've ever dug into more complex usage of mkdir on any Unix flavor, you've probably used the -p option before. It allows you to create a deep path with
Using WebWorkers One thing commonly seen as a limitation of JavaScript is the lack of a decent parallelization paradigm. Given the humble beginnings of the language, it is no surprise that one
Communicating between iframes with window.postMessage Since the late-90s, extensively using iframes has been maligned by webdesingers. Used in the improper way, they make it very hard to save application state, are often ignored by search