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
154 git
68 cd
56 make
52 vim
52 ls
25 sudo
14 npm
11 rm
10 ssh
10 node
@3rd-Eden
3rd-Eden / core.js
Created November 5, 2011 18:56
custom script loader
(function (global) {
var _namespace = global.namespace
, namespace = {};
namespace.push = function push (fn) {
return fn && typeof fn === 'function' && fn(namespace);
};
if (_namespace && _namespace.length) {
var i = _namespace.length;
@3rd-Eden
3rd-Eden / compare.js
Created October 30, 2011 19:15 — forked from WebReflection/document.retrieveSelector.js
retrieve a CSS selector out of a DOM node
(function () {
var all = document.getElementsByTagName('*')
, matches = 0
, misses = 0
, total = all.length
, i = all.length
, selector
, match;
while (i--) {
The "sys" module is now called "util". It should have a similar interface.
info - socket.io started
app listening on http://0.0.0.0:3000
node.js:202
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connect Unknown system errno 65
at errnoException (net.js:589:11)
at connect (net.js:473:18)
HTTPClient.prototype.end = function () {
var self = this;
Object.keys(this.agent.sockets).forEach(function (socket) {
console.log(self.agent.sockets[socket][0]._handle.socket.onend());
self.agent.sockets[socket]._handle.onend();
});
};
(function () {
var call = Function.prototype.call;
// override
Function.prototype.call = function () {
console.log('called', arguments.callee);
call.apply(call, arguments);
}
})();
/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
@3rd-Eden
3rd-Eden / parsers.js
Created October 13, 2011 09:55
Benchmark
var benchmark = require('benchmark')
, microtime = require('microtime')
, io = require('../')
, parser = io.parser;
var encoding = new benchmark.Suite
, decoding = new benchmark.Suite;
encoding.add('string', function () {
parser.encodePacket({
@3rd-Eden
3rd-Eden / HelloDartTest.dart
Created October 11, 2011 17:25
Dart Compilation
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// VMOptions=--compile_all
class HelloDartTest {
static testMain() {
print("Hello, Darter!");
@3rd-Eden
3rd-Eden / V8.regexp.bug.js
Created October 8, 2011 15:07
Regular expression bug in V8 and Node.js
var regexp = /\+((?:\+)?[\w\-]+)*(?:\.v\d+\.\d+\.\d+)?(?:\.js)$/g;
console.log(regexp.exec('/socket.io+websocket.v0.8.10.js')); // ["+websocket.v0.8.10.js", "websocket"]
console.log(regexp.exec('/socket.io+websocket.v0.8.10.js')); // null