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 constructor( args ) { | |
if( !(this instanceof constructor) ) return new constructor( args ); | |
// ... constructor stuff | |
} | |
constructor.prototype.method() {}; | |
constructor.method(); | |
/* |
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
var exec = require('child_process').exec; | |
app.all('*', function( req, res, next ) { | |
exec('component build --out ./public/js', next) | |
}) |
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 contains( element, search ) { | |
return element.indexOf( search ) != -1 ? true : false; | |
} |
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 pick( arg, def ) { | |
return ( typeof arg == 'undefined' ? def : arg ) | |
} |
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
Object.defineProperty(Object.prototype, 'extend', { | |
enumerable: false, | |
value: function( from ) { | |
Object.getOwnPropertyNames( from ).forEach(function( name ) { | |
if ( name in this ) { | |
Object.defineProperty( this, name, Object.getOwnPropertyDescriptor( from, name )); | |
} | |
}); | |
return this; |
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 b in window ) { | |
if( window.hasOwnProperty(b) ) console.log( b ); | |
} |
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
file:a |
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
var http = require('http'); | |
var url = process.argv[2]; | |
http.get(url, function (res) { | |
//res.setEncoding('utf-8'); | |
var bufs; | |
res.on('data', function (buf) { |
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 Fluid Images, Flash and HTML5 videos */ | |
img, | |
embed, | |
object, | |
video { | |
max-width: 100%; | |
} | |
/* <3 */ |
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
var decode = decodeURIComponent; | |
function parse(str) { | |
var obj = {}; | |
var pairs = str.split(/ *; */); | |
var pair; | |
if ('' == pairs[0]) return obj; | |
for (var i = 0; i < pairs.length; ++i) { | |
pair = pairs[i].split('='); | |
obj[decode(pair[0])] = decode(pair[1]); |
OlderNewer