Skip to content

Instantly share code, notes, and snippets.

Avatar

Rod Vagg rvagg

View GitHub Profile
View output
var Readable = require('stream').Readable;
var Writable = require('stream').Writable;
var readable = Readable();
readable._read = function(){
readable._t = setTimeout(function(){
readable.push(''+Date.now());
}, 100);
}
@rvagg
rvagg / kappa.conf
Created Feb 5, 2014
Upstart config for kappa-wrapper
View kappa.conf
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 4 240
setuid kappa
exec /usr/bin/kappa -c /etc/kappa/kappa-wrapper.json 2>&1
View 04_ee.js
var EventEmitter = require('events').EventEmitter;
var emitter = new EventEmitter;
var tick = true;
var count = 0;
setInterval(function() {
count ++;
if (tick) emitter.emit('tic', count);
View html
<h1>Testing code against many Node versions with Docker</h1>
<h2 id="the-problem-testing">The problem: testing</h2>
<p><strong><a href="https://github.com/rvagg/nan">NAN</a></strong> is a project designed to assist in building native (C++) Node.js add-ons while maintaining compatibility with Node and V8 from Node versions 0.8 onwards. V8 is undergoing <em>major</em> internal changes which is making add-on development very difficult; NAN's purpose is to abstract that pain. Instead of having to keep your code compatible across Node/V8 versions, NAN does it for you, and this is no simple task. But this means that we have to be sure to keep NAN tested and compatible with <em>all</em> of the versions it claims to support. This is no trivial exercise!</p>
<p><strong><a href="https://travis-ci.org/">Travis CI</a></strong> can help a little with this. It's possible to use <a href="https://github.com/creationix/nvm">nvm</a> to test across different versions of Node.js even beyond the officialy supported versions, we'v
@rvagg
rvagg / gist:96c959b7c31eedfa2c5c
Last active Aug 29, 2015
100 most downloaded npm packages for the period 6-Jul-2014 to 6-Aug-2014
View gist:96c959b7c31eedfa2c5c
1: async (5,306,139)
2: mkdirp (3,989,808)
3: request (3,822,748)
4: glob (3,750,793)
5: minimatch (3,476,898)
6: commander (3,475,471)
7: debug (3,454,917)
8: qs (3,372,442)
9: inherits (3,105,353)
10: graceful-fs (3,005,257)
View .jshintrc
{
"predef": [ ]
, "bitwise": false
, "camelcase": false
, "curly": false
, "eqeqeq": false
, "forin": false
, "immed": false
, "latedef": false
, "noarg": true
@rvagg
rvagg / compile error
Created Nov 7, 2014
ubuntu 12.04 node compile error, gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04)
View compile error
In file included from ../src/cares_wrap.cc:24:0:
../src/async-wrap.h:64:29: error: expected ‘;’ at end of member declaration
../src/async-wrap.h:64:31: error: ‘override’ does not name a type
In file included from ../src/cares_wrap.cc:29:0:
../src/req_wrap.h:48:12: error: expected ‘;’ at end of member declaration
../src/req_wrap.h:48:14: error: ‘override’ does not name a type
In file included from ../src/fs_event_wrap.cc:22:0:
../src/async-wrap.h:64:29: error: expected ‘;’ at end of member declaration
../src/async-wrap.h:64:31: error: ‘override’ does not name a type
../src/cares_wrap.cc:234:22: error: expected ‘;’ at end of member declaration
@rvagg
rvagg / nexus-check.js
Created Feb 17, 2015
Nexus 64GB Check
View nexus-check.js
// check if a Nexus 64GB is available
const urls = {
'White 64GB' : 'https://play.google.com/store/devices/details/Nexus_6_64_GB_Cloud_White?id=nexus_6_white_64gb&psid=3&iphc=true'
//, 'White 32GB' : 'https://play.google.com/store/devices/details/Nexus_6_32_GB_Cloud_White?id=nexus_6_white_32gb&psid=3&iphc=true'
, 'Blue 64GB' : 'https://play.google.com/store/devices/details/Nexus_6_64_GB_Midnight_Blue?id=nexus_6_blue_64gb&psid=3&iphc=true'
//, 'Blue 32GB' : 'https://play.google.com/store/devices/details/Nexus_6_32_GB_Midnight_Blue?id=nexus_6_blue_32gb&psid=3&iphc=true'
}
@rvagg
rvagg / changelog-maker
Created Apr 4, 2015
io.js 1.6.4 changelog-maker
View changelog-maker
rvagg@fletcher ~$ git clone git://github.com/iojs/io.js.git
Cloning into 'io.js'...
remote: Counting objects: 149486, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 149486 (delta 0), reused 0 (delta 0), pack-reused 149481
Receiving objects: 100% (149486/149486), 122.22 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (112753/112753), done.
Checking connectivity... done.
rvagg@fletcher ~$ cd io.js/
rvagg@fletcher (v1.x) ~/io.js$ changelog-maker --group
@rvagg
rvagg / commits.md
Created Jul 3, 2015
io.js commits in master and not in v1.x @ July 3rd 2015
View commits.md
You can’t perform that action at this time.