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("dbp._Handlebars"); | |
dojo.require("dijit._TemplatedMixin"); | |
(function(d) { | |
// lib/handlebars/parser.js | |
/* Jison generated parser */ | |
var handlebars = (function(){ | |
var parser = {trace: function trace() { }, | |
yy: {}, | |
symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1}, |
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(" myshit.external._Mustache"); | |
dojo.require("dijit._Templated"); | |
(function(d){ | |
/* | |
mustache.js — Logic-less templates in JavaScript | |
See http://mustache.github.com/ for more info. | |
*/ |
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
this.Jerk = (function(){ | |
// summary: Be a jerk. | |
// | |
// description: | |
// Mess with people. Extend prototypes, use faulty (read: wrong) | |
// implementations. Better yet, do it randomly. Bonus points if | |
// someone becomes criminally insane from debugging. | |
// | |
var threshold = 0.5; // how often do we want to fuck with folks. |
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 jerkify(obj, methods, thres){ | |
methods.forEach(function(meth){ | |
var orig = obj.prototype[meth]; | |
orig && obj.prototype[meth] = function(){ | |
return Math.random() > thres ? orig.apply(this, arguments) : orig.call(this); | |
} | |
}); | |
} | |
jerkify(Array, ["push", "pop", "splice", "slice"], 0.1); |
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
exports.ellipsis = function ellipsis(str, chunk, elip){ | |
// summary: Ellipsis some text. Break `str` into `chunk` sized | |
// bites (bytes?), breaking only on full words within the `chunk` size | |
// | |
// str: String | |
// The string to break apart. | |
// chunk: Integer: | |
// The size of the chunk | |
// elip: String? |
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
/* | |
monitor.js - monitors a javascript file and re-executes when file is | |
saved. eg: | |
$ node monitor.js /home/me/sample.js | |
Now edit /home/me/sample.js and watch the console output. Like a "live | |
firebug", though gives you the comfort of your own editor for quick | |
testing and prototyping. |
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("my/module", ["dojo", "dijit", "dojo/text!my/template.html", "dijit/_Widget"], function(dojo, dijit, template){ | |
return dojo.declare("my.module", [dijit._Widget], { | |
randomTemplate: template | |
}) | |
}); |
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
// untested poc/theory code | |
define(["dojo/parser"], function(parser){ | |
var asyncParser = function(rootNode, oldSupport){ | |
// summary: An asyncronous | |
var dfd = new dojo.Deferred(), | |
deps = dojo.query("[dojoType], [data-dojo-type]", rootNode).filter(function(n){ | |
return (n.getAttribute("data-dojo-type") || n.getAttribute("dojoType")).replace(/\./g, "/"); | |
}) |
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.onEnterPress = function(ref, context, method){ | |
// summary: Shorthand utility function for hooking up enter-key handling to a text input. | |
var ENTER = dojo.keys.ENTER, callback = method ? dojo.hitch(context, method) : context, ev = "keypress"; | |
if(typeof ref == "string"){ | |
ref = dojo.byId(ref); | |
}else if(ref && ref.declaredClass){ | |
ev = "onKeyPress"; | |
} | |