Modern 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 100% height of their container. In 2012, an update was published which showed a similar solution using jQuery. Both of these […]

Recursive 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 top of it at coordinates centered on a point on the prior circle circumference, with the number of degrees and […]

The 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.

Wrapping 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 heavy library for this small requirement. Additionally, there are many (many) solutions on StackOverflow — […]

Javascript 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 perform these basic operations:

There is a caveat: The EcmaScript specification doesn’t define an order in which keys are returned in […]

Creating 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 post focuses on extending our basic library with event handling. Out of the box event handling can be accessed  through Javascript and DOM apis, shown […]

Custom 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: LightEvents.publishEvent('event name', data); Subscribing to events is equally easy:

Here is the LightEvents object, demo is embedded below

JS Bin

Quick 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, and loads easily on all mobile, tablet, and desktop browsers. The rotator can be included multiple places on one […]

Interesting 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, will return the middle three digits I mentally wiped the sweat away from my forehead: whew — not computing bigO notation,  inventing a […]

Installing 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 manually, and wrote up this guide to installing WordPress on a Windows server manually. Hopefully this is what you are looking for! This guide makes […]

JavaScript 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 scope checks we can create well formed constructors that function as developers expect.

Creating your own JavaScript Library

One of the phases I went through while learning about JavaScript was the intense desire to write my own library, similar to jQuery (but massively scaled down). My library has gone through several major revisions — and more than one complete re-write, but now is exactly what I started out hoping it would be: functional, clean, small, […]

Convert < address > tags into Google Map link using jQuery

Relevant Stack Overflow Question While designing a page template for a University today, I realized that there were many areas of the future pages that would include street addresses: buildings, conferences, offices, ect..  I thought, “Wouldn’t it be nice if these addresses were links to Google Maps?” Then people could easily find directions or set […]