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 multipart(parts, done) { | |
this.boundary = multipart.generateBoundary(); | |
this.parts = []; | |
this.filecount; | |
var readycount = Object.keys(parts).length; | |
function updateReady() { | |
readycount--; | |
if (!readycount) { |
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 bind polyfill | |
* https://github.com/ariya/phantomjs/issues/10522 | |
*/ | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (context /* ...args */) { | |
var fn = this; | |
var args = Array.prototype.slice.call(arguments, 1); |