Skip to content

Instantly share code, notes, and snippets.

View cloudhead's full-sized avatar
🌴
On vacation

Alexis Sellier cloudhead

🌴
On vacation
View GitHub Profile
@cloudhead
cloudhead / gist:785650
Created January 19, 2011 03:40
WSS fix
From 1e2a3eb3d277f2adc0341fcf38309de7a7e80f93 Mon Sep 17 00:00:00 2001
From: Alexis Sellier <[email protected]>
Date: Tue, 18 Jan 2011 22:39:20 -0500
Subject: [PATCH] make 'readyState' available to CryptoStream
---
lib/tls.js | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/tls.js b/lib/tls.js
function process(items, callback) {
(function iterate(list) {
var item = list.shift();
if (item) {
process.nextTick(function () {
iterate(list);
});
} else {
callback('done!');
// View function to get all users which have a specific room_id
// in their 'rooms' array.
function(doc) {
if (doc.username) {
for (var i = 0; i < doc.rooms.length; i++) {
emit(doc.rooms[i], { avatar_url: doc.avatar_url, username: doc.username });
}
}
}
@cloudhead
cloudhead / gist:837942
Created February 21, 2011 23:51
Fix for process.removeListener(signal)
From 40ca5c222a853f20654e059e8ccf551b4f610874 Mon Sep 17 00:00:00 2001
From: cloudhead <[email protected]>
Date: Mon, 21 Feb 2011 18:49:32 -0500
Subject: [PATCH] fix process.removeListener with signal events
---
src/node.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/node.js b/src/node.js
From 13f75861414b07aa44345c549a04e0850a3cc2cf Mon Sep 17 00:00:00 2001
From: cloudhead <[email protected]>
Date: Mon, 21 Feb 2011 19:31:01 -0500
Subject: [PATCH] fix process.on edge case with signal event
When adding a listener for a signal event, removing it, and
adding it back again, it triggers a condition with an
undefined variable.
---
src/node.js | 2 +-
var vm = require('vm');
var context = {
data: 123,
run: function () {
return this.data;
}
}, result;
@cloudhead
cloudhead / gist:844802
Created February 26, 2011 01:01
Why 4 space tabs are better than two space tabs.
// 2 space tab
if (this.value) {
this.value++;
}
// 4 space tab
if (this.value) {
this.value++;
}
@cloudhead
cloudhead / gist:967157
Created May 11, 2011 19:38
LESS v1.1.0 - What's new

LESS v1.1.0 - What's new

@arguments special variable:

  .box-shadow () { -webkit-box-shadow: @arguments }

string interpolation:

content: "hello @{var}"; // replaced with value of @var

# declarations AST
# define DECLARATIONS
# include "Core.h"
# include "Types/Types.h"
# include <stdbool.h>
# undef DECLARATIONS
@cloudhead
cloudhead / gist:1522576
Created December 27, 2011 02:41
Why I Don't Write Web Apps

Why I Don't Write Web Apps (if I can help it)

This is what happens when I try to pick a language.

Note: If I didn't think it was possible to create a development environment without any of these issues (which I consider "major" for the most part), I would not have written this list.

C/C++

  • NOTHNX.

Node.js