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
// http://jsperf.com/new-vs-object-create-including-polyfill | |
if (typeof Object.create !== 'function') { | |
Object.create = function(o, props) { | |
function F() {} | |
F.prototype = o; | |
if (typeof(props) === "object") { | |
for (prop in props) { | |
if (props.hasOwnProperty((prop))) { | |
F[prop] = props[prop]; |
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
var CssFilterSupport = { | |
checkSupport : function(testCase){ | |
return window.CSS && _.isFunction(CSS.supports) && (CSS.supports("-webkit-filter", testCase) || CSS.supports("filter", testCase)); | |
}, | |
blur : function(){ | |
return this.checkSupport("blur(10px)"); | |
}, |
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
var log = function(){ | |
if(location.href.indexOf("debug_messi=1") > -1 ){ | |
var arg = $.makeArray(arguments); | |
arg.unshift("["+MODULE_NAME+"]"); | |
console.log.apply(console, arg); | |
} | |
}; |
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
var html = (function () {/* | |
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Hello, world!</h1> | |
</body> | |
</html> | |
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]; |
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
var request = require('request'); | |
var cheerio = require('cheerio'); | |
var fs = require('fs'); | |
var step =require('step'); | |
step( | |
function readUrl(){ | |
console.log("readUrl") |
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 | |
/** | |
npm install cheerio request step | |
chmod +x urlparser.js | |
./urlparser.js | |
*/ | |
var cheerio = require('cheerio') | |
, request = require('request') |
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
randomID = function(a,b) { | |
b=b||16; | |
return Array(a||32).join(0).replace(/0/g,function(){return(0|Math.random()*b).toString(b)}); | |
} |
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
var jQuery=function(selector){ | |
return { | |
addClass : function(){ | |
console.log("addClass()"); | |
return this; | |
}, | |
css : function(){ |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Ates Goral <http://magnetiq.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
var modulejs=function(name, source){ | |
var names = name.split(".") | |
, len = names.length | |
, context = this | |
, root = '' | |
, p=''; | |
if(!source){ | |
return; |