Monkey Patching Event Listeners
There was an interesting question in my local slack javascript community for a way to capture the performance of different events that happen on a page. One way that was suggested was to hook into the...
View ArticleRay tracing reflection depth demo
Here’s a quick visual demo of the effect of reflection depth in ray tracing, using the incredible Tiny Raytracer by Gabriel Gambetta. I have hosted a modified version of Tiny Raytracer on codepen for...
View ArticleAdding GraphQL to Ruby on Rails
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives...
View ArticleDynamic super classes (extends) in ES6
tl;dr Create a class factory which allows dynamic super classes to by applied to an es6 class (dynamic inheritance). This will be transparent to a consumer — meaning they will interact with it in the...
View ArticleAdding mp3 files to a Create React App app
If you’re looking for the steps to include static files, like an mp3, to a create-react-app project — and use es6 import statements to use them in a component, here are the steps. This process will...
View ArticleSimple React Examples
I ❤️ react, and have spent a bit of time teaching react concepts to others through bootcamp trainings, and university courses. Here are a few examples of concepts and code I’ve written for students...
View ArticleGetting Started with Data Visualization in React
A primary goal of data visualization is to communicate information clearly and efficiently via statistical graphics, plots and information graphics. Numerical data may be encoded using dots, lines, or...
View ArticleModern 100% height divs
In 2011 I published a popular article, 100% height Divs with 2 lines of code, which showed how to use JavaScript to get around the difficult layout problem of having two elements side-by-side both at...
View ArticleRecursive spiral art with canvas+javascript
Demo (Hide yo kids, hide yo RAM) See the Pen Fractal with inner circles by Michael Jasper (@mdjasper) on CodePen. Explanation The basic gist is that a circle is drawn, then another circle is drawn on...
View ArticleThe ultimate beginners guide to web performance and speed
Make your webpage blazingly fast! This beginners guide includes 14 performance tips (from simple to complex) that will help you speed up any site. No related posts.
View ArticleWrapping an element in Vanilla JavaScript
This is more of a snippet for my own memory — but here is a function to wrap an element (or set of elements with any arbitrary text. jQuery’s solution works well, but there’s no need to include such a...
View ArticleJavascript Object – Next and Previous Keys
I often need to perform “next” and “previous” operations on standard JavaScript objects or JSON objects. There is no built-in functionality to do this, so here are some helper functions I’ve created to...
View ArticleCreating your own JavaScript Library – part 2 – Event Handling
In Part 1 of Creating your own JavaScript library, we cover the library essentials: library design, creating a solid object constructor, and adding functions by extending the object prototype. This...
View ArticleCustom events system in JavaScript – LightEvents.js
Needing an event subscription and publishing system for a HTML5/canvas game I’m creating, I wrote a very light event system. Anything than can call JavaScript (link, button, etc) can raise an event:...
View ArticleQuick and reliable ad-rotator
In the course of my work, I’ve created and refined a simple ad rotator. It is built in JavaScript, and does not rely on any library, like jQuery, to function. In my experience, it defeats ad-block,...
View ArticleInteresting interview question #1
During an interview (for a software developer position) with a major employer in the state of Utah, I was asked an interesting programming question: Create a function that, given an integer parameter,...
View ArticleInstalling WordPress on a Windows Server (not through Gallery)
I administer a Windows server which runs multiple instances of WordPress. Today I needed to install another instance, but the Gallery Installer through IIS kept failing. I resorted to installing...
View ArticleJavaScript Constructors
Due to the familiar syntax of JavaScript, it is easy for experienced developers to make blunders without knowing it. One common problem is crafting object constructors. With some simple knowledge and...
View Article