Skip to content

Instantly share code, notes, and snippets.

View robbenmu's full-sized avatar
🤒
Out sick

Mr.Q robbenmu

🤒
Out sick
View GitHub Profile
{"sig":"c8a837e20d46f8a3479ebdd4411abb3d8d6ea3bd0838f88672114af8b46a7eed2de7b3f7e1d5942e683d1ae45dffa997a604326b7ceba51f8d0a9bb12290b5c51","msghash":"73ff8de45073830733c17a4243ed25ec72cbaa30bb158287e236c37a72e2e981"}
@robbenmu
robbenmu / call-invo-cursion.js
Created March 18, 2016 14:01 — forked from cowboy/call-invo-cursion.js
JavaScript: call invo-cursion?
// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
/*!
* JavaScript preload() function
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Demo: http://mathiasbynens.be/demo/javascript-preload
*/
function preload(arr) {
var i = arr.length,
//detect Internet Explorer and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check)
//version arg is for IE version (optional)
//comparison arg supports 'lte', 'gte', etc (optional)
var isIE = (function(undefined){
var doc = document,
doc_elem = doc.documentElement,
cache = {},