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
#!/usr/bin/env node | |
var repl = require('repl'), | |
vm = require('vm'), | |
useGlobal = true; | |
function evalWithHistory(code, context, file, callback){ | |
// TOOD: write history saving routines | |
var err, result; | |
try{ | |
if(useGlobal){ |
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
# vim: set filetype=zsh: | |
if [[ $# -eq 0 ]]; then | |
echo "Usage: hostit [-l] [[-d -f] hostname]" | |
return | |
fi | |
REMOVE_HOST=0 | |
FORCE_HOST=0 | |
LIST_HOSTS=0 |
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
define([ | |
'exports', | |
'dojo/has', | |
'dojo/dom' | |
], function(exports, has, dom){ | |
has.add('dom-dataset', function(global, document, element){ | |
return typeof element.dataset === 'object' && !!element.dataset; | |
}); | |
var ccRE = /(-+)([^-])/g; |
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
define(["dojo/domReady!"], function(domReady){ | |
function init(){ | |
// do something on domReady | |
} | |
(domReady||init)(init); | |
}); |
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
// Implemented as a monkey-patch for dijit/_OnDijitClickMixin | |
define([ | |
"dijit/_OnDijitClickMixin", | |
"dojo/on", | |
"dojo/_base/window", | |
"dojo/dom-geometry", | |
"dijit/registry", | |
"dojo/domReady!" | |
], function(_OnDijitClickMixin, on, win, domGeometry, registry){ |
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
define(['../Evented', '../_base/lang', './util'], function(Evented, lang, util){ | |
// module: | |
// dojo/request/notify | |
// summary: | |
// Global notification API for dojo/request | |
// | |
// | require('dojo/request', 'dojo/request/notify', | |
// | function(request, notify){ | |
// | notify('load', function(response){ | |
// | if(response.url === 'someUrl.html'){ |
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
define([ | |
"dojo/Deferred", | |
"dojo/promise/all", | |
"dojo/node!fs", | |
"dojo/node!path" | |
], function(Deferred, all, fs, path){ | |
var slice = Array.prototype.slice; | |
function adapt(func){ | |
var args = slice.call(arguments, 1), | |
def = new Deferred; |
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
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 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test</title> | |
<script> | |
var dojoConfig = { | |
async: true | |
}; |
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 makeError(name, ctor, base, props){ | |
base = base || Error; | |
var ErrorCtor = function(message){ | |
if(base === Error){ | |
Error.captureStackTrace && Error.captureStackTrace(this, ErrorCtor); | |
base.call(this, message); | |
}else{ | |
base.apply(this, arguments); | |
} | |
ctor && ctor.apply(this, arguments); |