Skip to content

Instantly share code, notes, and snippets.

// 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];
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)");
},
var log = function(){
if(location.href.indexOf("debug_messi=1") > -1 ){
var arg = $.makeArray(arguments);
arg.unshift("["+MODULE_NAME+"]");
console.log.apply(console, arg);
}
};
var html = (function () {/*
<!DOCTYPE html>
<html>
<body>
<h1>Hello, world!</h1>
</body>
</html>
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];
var request = require('request');
var cheerio = require('cheerio');
var fs = require('fs');
var step =require('step');
step(
function readUrl(){
console.log("readUrl")
#!/usr/bin/env node
/**
npm install cheerio request step
chmod +x urlparser.js
./urlparser.js
*/
var cheerio = require('cheerio')
, request = require('request')
randomID = function(a,b) {
b=b||16;
return Array(a||32).join(0).replace(/0/g,function(){return(0|Math.random()*b).toString(b)});
}
var jQuery=function(selector){
return {
addClass : function(){
console.log("addClass()");
return this;
},
css : function(){
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
var modulejs=function(name, source){
var names = name.split(".")
, len = names.length
, context = this
, root = ''
, p='';
if(!source){
return;