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( [ | |
"app", "common", "utils", "contacts", "hiring" | |
], function(app, common, utils, contacts, hiring) { | |
}); |
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
<html> | |
<head> | |
<script src="require.js" data-main="main"></script> | |
</head> | |
<body> | |
Welcome to the modern era! | |
</body> | |
</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
// Heuristic to guess if code is minified. | |
// http://regex101.com/r/oE3nP0 | |
if ( /function[ ]?\w*\([\w,]*\)\{(?:\S[ ]?){1000,}\}/g.test(text) ) { | |
return; | |
} |
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
for (var i in el[0]) { | |
if (i[0] === 'o' && i[1] === 'n') { | |
defineEvent(el, i.substr(2)); | |
} | |
} | |
function defineEvent(el, evtType) { | |
var evtDef = { | |
name: evtType, |
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 stripMinified(text) { | |
// var regex = /function[ ]?\w*\([\w,]*\)\{(?:\S[\s]?){150,}\}/gm; | |
// var regex = /(?:\S[\s]?){150,}[\n]$/gm; | |
var regex = /(?:.){250,}/gm; | |
return text.replace(regex, function() {return "";}); | |
} |
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 fixPath(path) { | |
return path.replace(/^([A-Za-z]+:)?\//, function (match) { | |
return match.toLocaleLowerCase(); | |
}); | |
} |
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
// https://regex101.com/r/aH9kH3/21 | |
function parseUrl (urlString) { | |
return /^((https?:)(\/\/\/?)(?:([\w]+)(?::([\w]*))?@)?([\d\w\.-]+)(?::(\d+))?)?([\/\\\w\.()-]*)?(?:([?][^#]*)?(#.*)?)*/gmi.exec(urlString); | |
} |
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
// http://regex101.com/r/zT4pG0/6 | |
function parseUrl (urlString) { | |
return /(?:^(file:)(\/\/\/?))?(([A-Za-z-]+:)?[/\\d\w\.\s-]+)/gmi.exec(urlString); | |
} |
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 printStack() { | |
try { | |
throw new TypeError(""); | |
} | |
catch(ex) { | |
console.log(ex.stack); | |
} | |
} |
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
/** | |
* Task manager to handle queuing up async tasks in an optimal manner | |
*/ | |
var TaskManager = { | |
_asyncQueue: [], | |
asyncTask: function(task) { | |
if (TaskManager._asyncQueue.push(task) === 1) { | |
async(TaskManager.taskRunner(TaskManager._asyncQueue)); | |
} | |
}, |