Skip to content

Instantly share code, notes, and snippets.

View 3rd-Eden's full-sized avatar
💭
I have approximate knowledge of many things

Arnout Kazemier 3rd-Eden

💭
I have approximate knowledge of many things
View GitHub Profile
@3rd-Eden
3rd-Eden / 0.10.0
Last active December 14, 2015 22:49
log: Finished benchmarking: "hashring"
metric: Count (24), Cycles (3), Elapsed (5.514), Hz (279.3055714216432)
info: Benchmark: "hashring" is was the fastest.
log: Finished benchmarking: "hashring"
metric: Count (2331), Cycles (3), Elapsed (5.565), Hz (26024.566288707978)
info: Benchmark: "hashring" is was the fastest.
log: Finished benchmarking: "hashring"
metric: Count (913498), Cycles (5), Elapsed (5.628), Hz (13366679.214176746)
info: Benchmark: "hashring" is was the fastest.
@3rd-Eden
3rd-Eden / metrics.json
Created February 28, 2013 19:17
metrics
{
"304": 221,
"404": 18,
"cache size": "471.69kb",
"requests": 1737,
"versioned": 619,
"origin server pull": 474,
"cache hit": 1037,
"inspect": 1,
"metrics": 1
this.io = this.engine = new Engine.Server();
//
// Handle WebSocket server upgrades, again, check if it's a valid request.
// BE-AWARE HERE BE DEMONS AND MONKEY PATCHES.
// - There is no way to re-using the middleware that is specified in
//
server.on('upgrade', function upgrade(req, socket, head) {
req.originalUrl = req.url; // connect compatibility
common.async.series([
self.cookieParser.bind(self.cookieParser, req, socket)
info: Creating snapshot 1.0.0-14
info Uploading: [=============================] 100%
info: Updating app webops
info: Activating snapshot 1.0.0-14 for webops
info: Starting app webops
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy the app
error:
error: package.json error: can't find starting script: node server/index.js
info: Creating snapshot 0.0.0-2
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: npm http GET http://nj-npm.irisnpm.com/connect
npm http GET http://nj-npm.irisnpm.com/cookie
npm http GET http://nj-npm.irisnpm.com/expirable
npm http GET http://nj-npm.irisnpm.com/ms
npm http GET http://nj-npm.irisnpm.com/request
npm http 200 http://nj-npm.irisnpm.com/cookie
log: Finished benchmarking: "Standard prototype inherit invocation"
metric: Count (1647103), Cycles (5), Elapsed (5.479), Hz (26747211.310071196)
log: Finished benchmarking: "__proto__ inherit invocation"
metric: Count (2397699), Cycles (4), Elapsed (5.421), Hz (32267883.112610027)
log: Finished benchmarking: "util.inhertis"
metric: Count (1655519), Cycles (4), Elapsed (5.423), Hz (25041778.437022544)
info: Benchmark: "__proto__ inherit invocation" is was the fastest.
.3rdeden {
background-image: url(gravatar('[email protected]', '[email protected]'))
}
// generates a valid gravatar that defaults to company e-mail and then a known github e-mail
@3rd-Eden
3rd-Eden / bundled
Created January 7, 2013 15:30
https://raw.github.com/LearnBoost/socket.io/master/package.json Bundling redis instead of an optional dependency
{
"name": "socket.io"
, "version": "0.9.13"
, "description": "Real-time apps made cross-browser & easy with a WebSocket-like API"
, "homepage": "http://socket.io"
, "keywords": ["websocket", "socket", "realtime", "socket.io", "comet", "ajax"]
, "author": "Guillermo Rauch <[email protected]>"
, "contributors": [
{ "name": "Guillermo Rauch", "email": "[email protected]" }
, { "name": "Arnout Kazemier", "email": "[email protected]" }
@3rd-Eden
3rd-Eden / tabs.js
Created November 15, 2012 11:00
standalone tabs.js
(function () {
'use strict';
var slice = Array.prototype.slice;
slice.call(
document.querySelectorAll('ul.vertical-tabs a[data-trigger]')
, 0).forEach(function each(a) {
a.addEventListener('click', function click(e) {
e.preventDefault();
@3rd-Eden
3rd-Eden / sessions.js
Created October 31, 2012 13:15
Socket.IO / Express / Connection sid parsing
// Setup authorization for socket.io to ensure that the user actually has
// access to this socket.io instance
io.set('authorization', function authorization(handshake, done) {
if (!handshake.headers.cookie) return done('No cookie transmitted', false);
var sessionID = /connect.sid\=([^;]+)/g.exec(handshake.headers.cookie);
if (sessionID && sessionID.length) handshake.sessionID = unescape(sessionID[1]).split('.')[0].slice(2);
// Only allow connections that are logged in.
sessions.get(handshake.sessionID, function (err, sess) {