Skip to content

Instantly share code, notes, and snippets.

Avatar

Eirik L. Vullum eiriklv

View GitHub Profile
@kolber
kolber / pandoras_vox.mdown
Created Mar 20, 2012
pandora’s vox: on community in cyberspace
View pandoras_vox.mdown

pandora’s vox: on community in cyberspace

by humdog (1994)

when i went into cyberspace i went into it thinking that it was a place like any other place and that it would be a human interaction like any other human interaction. i was wrong when i thought that. it was a terrible mistake.

the very first understanding that i had that it was not a place like any place and that the interaction would be different was when people began to talk to me as though i were a man. when they wrote about me in the third person, they would say “he.” it interested me to have people think i was “he” instead of “she” and so at first i did not say anything. i grinned and let them think i was “he.” this went on for a little while and it was fun but after a while i was uncomfortable. finally i said unto them that i, humdog, was a woman and not a man. this surprised them. at that moment i realized that the dissolution of gender-category was something that was happening everywhere, and perhaps it was only just very obvious on the ne

@dtao
dtao / eachAsync.js
Created Apr 10, 2012
Function to asynchronously iterate over a collection
View eachAsync.js
function eachAsync(collection, iterator, callback) {
var iterate = function(i) {
setTimeout(function() {
iterator(collection[i]);
if (i < collection.length) {
iterate(i + 1);
} else {
callback();
}
}, 0);
View style_guide.md

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

@passcod
passcod / dom-loaded-test.html
Created May 26, 2012
onload, readyState, and DOMContentLoaded
View dom-loaded-test.html
<!DOCTYPE html>
<html>
<head>
<script>
window.onload = function () {
console.log(''+(+new Date)+': Onload fired');
};
document.onreadystatechange = function () {
console.log(''+(+new Date)+': Ready state changed');
@scttnlsn
scttnlsn / README.md
Created Jul 30, 2012
Pub/sub with MongoDB and Node.js
View README.md

Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
View 1088.js
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
mongoose.connect('localhost', 'testing_1088');
mongoose.connection.on('error', function () {
@puffnfresh
puffnfresh / do.sjs
Created Oct 4, 2012
do-notation using sweet.js
View do.sjs
macro $do {
case { $y:expr } => {
$y
}
case { $x:ident <- $y:expr $rest ... } => {
λ['>=']($y, function($x) {
return $do { $rest ... }
});
}
}
@brentertz
brentertz / emitter.js
Created Oct 20, 2012
Node.js: Extend a class to be an EventEmitter
View emitter.js
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
View gist:3949948
var exchange = require('./exchange');
module.exports = BinaryHeap;
function BinaryHeap(scoreFunction, options){
this.content = [];
if (options)
this.options = options;
else
this.options = {};
@donnut
donnut / main.js
Created Nov 1, 2012
populating a referenced mongoose model, three levels deep
View main.js
var mongoose = require('mongoose'),
assert = require('assert')
mongoose.connect('localhost/mydb');
var Schema = mongoose.Schema;
var ContainerSchema = new Schema({
name: String,
})