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
/// ice/logging/advanced.js | |
define(function (require, exports) { | |
exports.log = function (message, options) { | |
// ... | |
}; | |
exports.error = function (message, options) { | |
// ... | |
}; | |
}); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test</title> | |
<style> | |
#test { | |
width: 300px; | |
height: 300px; |
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 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 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 secretSanta(array) { | |
var year = (new Date).getYear(), | |
offset = year % array.length, | |
map = {}; | |
array.forEach(function (item, index) { | |
map[item] = array[index + offset] || array[array.length - (index + offset)]; | |
}); | |
return map; |
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
has.add("css-user-select", function(global, doc, element){ | |
var style = element.style; | |
if(typeof style.userSelect !== "undefined"){ | |
// Unlikely; user-select is non-standard, but might as well be future-proof... | |
return "userSelect"; | |
} | |
var prefixes = ["Khtml", "O", "ms", "Moz", "Webkit"], | |
i = prefixes.length, | |
prefix, name; |
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 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 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 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 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 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 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([ | |
'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; |