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
From dc080c16ef4fd2c15282d3a2f0b9449c35889bab Mon Sep 17 00:00:00 2001 | |
From: Jerome Etienne <jerome.etienne@gmail.com> | |
Date: Thu, 19 Aug 2010 14:10:45 +0200 | |
Subject: [PATCH] fix request port handling | |
--- | |
proxy.js | 3 ++- | |
1 files changed, 2 insertions(+), 1 deletions(-) | |
diff --git a/proxy.js b/proxy.js |
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
$ npm adduser | |
Username: jerome.etienne | |
Password: | |
Email: (jerome.etienne@gmail.com) | |
npm info it worked if it ends with ok | |
npm info version 0.1.27-12 | |
npm ok |
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
/** | |
* Callback for http_server | |
* - it handles the proxying itself | |
*/ | |
function http_server_cb(request, response){ | |
// extract path extname for the request url | |
var parsedUrl = require('url').parse(request.url, true); | |
var query = parsedUrl.query; | |
var req_url = query.url; |
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
if(typeof THREEx === "undefined") var THREEx = {}; | |
THREEx.windowResize = function(renderer, camera){ | |
this.callback = function(){ | |
renderer.setSize( window.innerWidth, window.innerHeight ); | |
camera.aspect = window.innerWidth / window.innerHeight; | |
camera.updateProjectionMatrix() | |
} | |
window.addEventListener('resize', this.callback); | |
return { | |
unbind : function(){ |
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
try { | |
var webGlSupport = !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl'); | |
}catch(e){ | |
var webGlSupport = false; | |
} | |
console.log("webglSupport", webGlSupport); |
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> | |
<body> | |
<p> | |
sdfsdf | |
</p> | |
</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
/** | |
* Provides requestAnimationFrame in a cross browser way. | |
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
*/ | |
if ( !window.requestAnimationFrame ) { | |
window.requestAnimationFrame = ( function() { | |
return window.webkitRequestAnimationFrame || |
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
// see http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// shim layer with setTimeout fallback | |
(function(){ | |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || |
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
// attempts to get flash/session accessible in any template | |
// - this middleware function fails and keep producing 'Error: req.flash() requires sessions' | |
// - this middleware has been place *after* session middleware in the stack | |
app.use(function(req,res, next){ | |
console.log("flash middleware") | |
res.locals({ | |
session : req.session, | |
flash : req.flash() | |
}); | |
}); |
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(exports){ | |
/** | |
* Insert http://jsconsole.org in the page | |
*/ | |
exports.jsconsoleInsert = function(id){ | |
if( !!navigator.userAgent.match(/iPod/) || !!navigator.userAgent.match(/iPad/) ){ | |
document.write(unescape("%3Cscript src='http://jsconsole.com/remote.js?"+id+"' type='text/javascript'%3E%3C/script%3E")); | |
} | |
} | |
})(this); |