Skip to content

Instantly share code, notes, and snippets.

@hugeen
hugeen / gist:4662065
Created January 29, 2013 05:33
Convert XML to JSON with JavaScript
// Source From http://davidwalsh.name/convert-xml-json
// Changes XML to JSON
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
@hugeen
hugeen / CGLM.example.js
Created September 1, 2011 23:03 — forked from kirbysayshi/CGLM.example.js
My attempt at two methods of a constant game-loop in JavaScript
// Example CGLM usage:
ZAP.CGLM
.setMode('custom')
.mode
.setFPS(30)
.setTimeStep(10)
.setSpeedX(1);
function priorityOne(dt, stats){