- http://tutsplus.com/tutorial/writing-modular-javascript/
- https://github.com/aranm/scalable-javascript-architecture
- https://github.com/patrick99e99/scalable-js-architecture-app
- http://scaleapp.org/
- http://addyosmani.com/largescalejavascript/
- https://github.com/tcorral/Hydra.js/
- http://alanlindsay.me/kerneljs/
- http://terrifically.org/
- https://github.com/gorillatron/cerebral
This file contains hidden or 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
dojo.provide("dojox.mustache._Templated"); | |
dojo.require("dijit._Templated"); | |
// | |
// INSTALL: copy http://github.com/janl/mustache.js to this folder as _base.js | |
// Add dojox.mustache = dojo.hitch(Mustache, "to_html") in _base.js, wrapping | |
// the whole file in a self-executing-anonymous-function. eg: | |
// | |
// dojo.provide("dojox.mustache._base"); | |
// (function(){ | |
// /* contents of Mustache.js */ |
This file contains hidden or 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(d){ | |
console.log("Wrapping dojo.connect/subscribe"); | |
var dc = d.connect, | |
ddc = d.disconnect, | |
ds = d.subscribe, | |
dus = d.unsubscribe, | |
uniqueHandleId = 0, | |
handleIds = {}; | |
var handleData = { connect: 0, disconnect: 0, subscribe: 0, unsubscribe: 0 }; |
This file contains hidden or 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 bind = function (prev, bridge) { | |
return function (input) { | |
var result = prev(input); | |
return result.length === 0 ? result : bridge(result[0])(result[1]); | |
}; | |
}; | |
var result = function (a) { | |
return function (input) { | |
return [a, input]; |
This file contains hidden or 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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
/* | |
* lesswatch usage: | |
* | |
* `lesswatch` to watch the current directory |
This file contains hidden or 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
/* vim:set ts=2 sw=2 sts=2 expandtab */ | |
/*jshint asi: true undef: true es5: true node: true devel: true | |
forin: false latedef: false */ | |
/*global define: true */ | |
if (typeof(WeakMap) === 'undefined') WeakMap = (function(global) { | |
"use strict"; | |
function defineNamespace(object, namespace) { |
This file contains hidden or 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
#!/usr/bin/env node | |
/* | |
tunlr - simple SSH tunnel management | |
usage: tunlr [options] [command] | |
options: | |
-q quiet. suppress console output. |
This file contains hidden or 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
// Original - @Gozola. This is a reimplemented version (with a few bug fixes). | |
window.WeakMap = window.WeakMap || (function () { | |
var privates = Name() | |
return { | |
get: function (key, fallback) { | |
var store = privates(key) | |
return store.hasOwnProperty("value") ? | |
store.value : fallback | |
}, |
This file contains hidden or 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
define([ | |
"dojo/Deferred" | |
], function(Deferred){ | |
var slice = Array.prototype.slice; | |
return function adapt(func){ | |
var args = slice.call(arguments, 1), | |
def = new Deferred; | |
args.push(function(err, value){ | |
if(err){ |
This file contains hidden or 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
collectionModel = /* could be from some model constructor with direct data array, from a query result, a URL, or whatever */ | |
// first we bind the collectionModel to this TC, so there will be a child widget created for each item in the array | |
// the binding will handle observing the collection model for changes to add and remove children | |
bind(collectionModel, new TabContainer()) | |
.forEach(function(item){ // called for each child | |
var cp = new ContentPane({}); // create the child widget to use (could be optional) | |
var form = cp.domNode; // get the domNode to attach the children | |
OlderNewer