Resources in the wild:
How-to steps:
var view = ko.views.manager.currentView, | |
scimoz = view.scimoz, | |
selection = scimoz.selText || scimoz.text, | |
service = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService), | |
log = function() { | |
var message = ''; | |
for (var i = 0; i < arguments.length; i++) { | |
message += arguments[i] + ' '; | |
} | |
window.dragger = (function() { | |
var requestAnimationFrame = (function() { | |
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || | |
function(callback) { | |
return setTimeout(callback, 17); | |
} | |
})(); |
var view = ko.views.manager.currentView, | |
scimoz = view.scimoz, | |
selection = scimoz.selText, | |
result = null, | |
log = function() { | |
var message = ''; | |
for (var i = 0; i < arguments.length; i++) { | |
message += arguments[i] + ' '; | |
} |
/** | |
* Change file modification time to the date from EXIF | |
* | |
* System Requirements: | |
* | |
* > npm install -g includejs | |
* > npm install -g exif | |
* | |
* Usage: | |
* |
RegExp.fromString = function(str, flags) { | |
return new RegExp(str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), flags); | |
}; |
var obj_normalize = (function() { | |
function runNormalizer(currentValue, normalizer) { | |
if (typeof normalizer === 'function') | |
return normalizer(currentValue); | |
// other types of normalization, like Regexp-Replace | |
return currentValue.replace(normalizer[0], normalizer[1]); |
function Deferred(){} | |
(function(){ | |
Deferred.prototype = { | |
_isAsync: true, | |
_done: null, | |
_fail: null, | |
_always: null, |
// atma-class | |
// common node.js and browser | |
var Article = Class('Article', { | |
Base: Class.Serializable({ | |
date: Date | |
}), | |
_id: null, | |
date: null, | |
body: '', |
Resources in the wild:
How-to steps:
var x = new RegExp( "/" ) | |
console.log(x.test( "/hello" )); | |
var serializedRegexParser = /^\/(.+)\/(\w+)?$/ | |
var serializedRegex = x.toString(); | |
console.log('serializedRegex:', serializedRegex); | |
var matches = serializedRegexParser.exec(serializedRegex); | |
var [full, regexString, regexFlags] = matches; |