optional tagline
Short description of what it is and what it does. Possibly even what it does not.
- Minimum possible steps
- developer need take to start developing
// 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; |
// MutationObserver | |
(function(){ | |
var pluginName = "domChangeHandler"; | |
var defaults = {}; | |
var DOMChangeHandler = function(HTMLElement, options) { | |
this.options = options || {}; | |
this.handler = new MutationsObserver(changeEventHandler); | |
this.handler.observe(HTMLElement); |
validateYears: function(Class, prop) { | |
var input = Ember.get(Class, prop), | |
regex = /\D*(\d*)\.?(\d{2}).*/, | |
result; | |
if (input.length > 0) { | |
this.set('errorMsg', null); | |
if (input.match(regex)) { | |
result = input.replace(regex, "$1,$2").replace(/[,]/g, '.'); |
/* more functional version using concat */ | |
function uniq(array) { | |
return array.reduce(function(result, currentElement) { | |
if (result.indexOf(currentElement) < 0) { | |
return results.concat([currentElement]); | |
} | |
return result; | |
}, []); | |
} |
(function($){ | |
var o = $( {} ); | |
$.each({ | |
on: 'subscribe', | |
trigger: 'publish', | |
off: 'unsubscribe' | |
}, function( key, api ) { | |
$[api] = function() { |
// 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); |
// 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 |
var express = require('express'), | |
fs = require('fs'), | |
app = express(), | |
port = 8080; | |
function getInt (num) { | |
return parseInt(num, 10); | |
} | |
function readJSONFile (path, callback) { |