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 / fubar.js
Created October 24, 2012 18:06
memleak?
// readStream that isn't piped in to anything
var s = require('fs').createReadStream('/dev/random');
setTimeout(function kill(){
s.destroy();
console.log('stream killed');
if ('gc' in global) {
global.gc();
console.log('Garbage collected');
@3rd-Eden
3rd-Eden / logo.html
Created October 10, 2012 20:02
The Nodejitsu logo in pure CSS
This file has been truncated, but you can view the full file.
<style>
.css-img {
   position: relative;
   width: 396px;
   height: 270px;
}
.pixel {
   height: 1px;
   width: 1px;
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․
✖ 2 of 54 tests failed:
1) server close should trigger if a poll request is ongoing and the underlying socket closes, as in a browser tab close:
TypeError: Cannot read property 'length' of undefined
at EventEmitter.listen.allowUpgrades (/Users/V1/Projects/3rd-Eden/engine.io/test/server.js:397:25)
at EventEmitter.emit (/Users/V1/Projects/3rd-Eden/engine.io/node_modules/engine.io-client/lib/event-emitter.js:158:13)
at EventEmitter.Polling.poll (/Users/V1/Projects/3rd-Eden/engine.io/node_modules/engine.io-client/lib/transports/polling.js:103:8)
at EventEmitter.Polling.onData (/Users/V1/Projects/3rd-Eden/engine.io/node_modules/engine.io-client/lib/transports/polling.js:138:10)
@3rd-Eden
3rd-Eden / semicolon.css
Created July 20, 2012 09:37
semicolon first css
.rule {
background: red
; border: 1px solid blue
; color: #F06
; text-decoration: none
}
@3rd-Eden
3rd-Eden / api.js
Created June 16, 2012 20:06
RED API
'use strict';
/**
* Require the RED module.
*/
var RED = require('RED');
/**
* Create a new RED server.
*/
"use strict";
var connect = require('connect')
, app = connect.createServer(connect.static(__dirname))
, tweet = require('./tweet').stream;
var io = require('socket.io').listen(app);
app.listen(8080);
@3rd-Eden
3rd-Eden / remote.js
Created February 4, 2012 22:32
Uniform remote address interface for Node.js
var http = require('http')
, request = http.IncomingMessage.prototype;
/**
* Add a uniform interface for remote address in Node.js
*
* @api private
*/
request.__defineGetter__('remote', function remote () {
npm http GET https://registry.npmjs.org/kue/0.3.3
npm http 304 https://registry.npmjs.org/kue/0.3.3
npm http GET https://registry.npmjs.org/express/2.5.0
npm http GET https://registry.npmjs.org/jade/0.17.0
npm http GET https://registry.npmjs.org/stylus/0.19.2
npm http GET https://registry.npmjs.org/nib/0.2.0
npm http GET https://registry.npmjs.org/reds/0.1.1
npm http 304 https://registry.npmjs.org/nib/0.2.0
npm http 304 https://registry.npmjs.org/express/2.5.0
npm http 304 https://registry.npmjs.org/stylus/0.19.2
[node@vanilla ~/build/GeoIP-1.4.8]$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
mixin bar(active)
- var topbar = [
- { href: '/', title: 'Home' }
- , { href: '/foo', title: 'bar' }
- ];
each item in topbar
if item.title === active.toLowerCase()
li.active: a(href="#{item.href}", title="#{item.title}")= item.title
else