This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MutationObserver | |
(function(){ | |
var pluginName = "domChangeHandler"; | |
var defaults = {}; | |
var DOMChangeHandler = function(HTMLElement, options) { | |
this.options = options || {}; | |
this.handler = new MutationsObserver(changeEventHandler); | |
this.handler.observe(HTMLElement); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node { id: [Number], nodeTypeId: [String] } | |
// edge { fromNodeId: [Number], toNodeId: [Number], fromPort: [String] } | |
var decisionTree = { | |
nodes: [], | |
edges: [], | |
getTreeMatrix: function() { | |
var start = this.nodes.findBy('nodeTypeId', 'StartNode'), | |
self = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
fs = require('fs'), | |
app = express(), | |
port = 8080; | |
function getInt (num) { | |
return parseInt(num, 10); | |
} | |
function readJSONFile (path, callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global module:false*/ | |
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
// Task configuration. | |
express: { | |
dev: { | |
options: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
body { | |
background: black; | |
color: yellow; | |
font-family: Helvetica; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A response to jashkenas's fine proposal for minimalist JavaScript classes. | |
// Harmony always stipulated classes as sugar, so indeed we are keeping current | |
// JavaScript prototype semantics, and classes would only add a syntactic form | |
// that can desugar to ES5. This is mostly the same assumption that Jeremy | |
// chose, but I've stipulated ES5 and used a few accepted ES.next extensions. | |
// Where I part company is on reusing the object literal. It is not the syntax | |
// most classy programmers expect, coming from other languages. It has annoying | |
// and alien overhead, namely colons and commas. For JS community members who |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind. | |
// Hat tip Paul Irish | |
var o = $( {} ); | |
$.sub = o.on.bind(o); | |
$.unsub = o.off.bind(o); | |
$.pub = o.trigger.bind(o); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var o = $( {} ); | |
$.each({ | |
on: 'subscribe', | |
trigger: 'publish', | |
off: 'unsubscribe' | |
}, function( key, api ) { | |
$[api] = function() { |
NewerOlder