{title}


Code RSS Feed

Code

webGL circular camera rotation around a single axis in threeJS

For anyone who’s good with math, I suppose this is a fairly easy one, but if you’re not, rotating a camera in threeJS can be a bit tricky. I did a lot of asking around, and most of the answers I got involved using pre-built libraries such as the built in trackball controls, or the great drag-pan...

Read More

Converting a server-reliant XML website using XML to run on the local file system.

Recently I had to convert a website that had once run off a server to run locally, so that we could demo the site without the need for an internet connection. The site didn’t use PHP or any server-side scripting language, so it seemed doable - the only problem was that it used data from an XML feed...

Read More

SVG path animations with D3

I recently stumbled on an incredible HTML5 graphics library called d3. It’s well documented, powerful, smooth, and pretty. The problem is, most of the folks that use it well are apparently geniuses, so support for learning from the ground up can be a bit limited. There are plenty of examples out...

Read More

Load processing.js sketch with ajax on user click

I’ve had a few questions on this, so I figured I’d write a quick tutorial. Loading a java applet through AJAX doesn’t tend to work too well. Processing.js, however, makes this fairly easy, especially when coupled with jQuery. In order to load a sketch through AJAX, you need to include of course,...

Read More

A Simplified Vimeo (Froogaloop) Javascript API Example

Hi - recently I was trying to utilize the Vimeo Javascript API to do some basic event listening - I wanted to make sure that when one video in a series of videos finished playing, that it would load the next video and play it. Vimeo has 3 different APIs - a simple API which is used primarily to get...

Read More

Creating a donut wedge in Flash AS3

I recently had a project in which I needed to draw a sort of graph in which there is a center circle, and wedge shaped pieces that surround that circle. Turns out drawing even drawing an arc is difficult in flash (much less a wedge, much less a wedge that has an inner radius). I went about this all...

Read More

Sort an Array of Objects by an Object Property in JQuery

This is a quick snippet that often comes in handy - you have a bunch of objects which are being added to an array in no particular order, and you want to sort that array into some logical order, using a common property that all of the objects possess. The code is simple:

var array = [(idname...
Read More

Get an ISO 8601 Formatted Date in Javascript

Recently I had to submit an ISO 8601 timestamp in order to use Amazon’s AWS API - unfortunately there’s no cut and dry method of doing this in javascript like there is in other languages. I finally came across this method, which I figured I’d share.

function ISODateString(d){
          
function ...
Read More

A way around access control origin errors

Ever try to post to a web service or access AJAX data from a different domain, and get those annoying access-control origin errors? Often, these result from the remote host’s server configuration being not set up to accommodate requests from your IP. If accessing the remote server is something that...

Read More

Dynamic Dependent Dropdown filtering with Codeigniter and JQuery

Say you’re building a form in which users can create a person, and assign that person a city to live in. But that city field needs to be populated depending on the state the person lives in, otherwise the city field will be enormously long (and there is more of a chance for user error and...

Read More