View parse.js
1 2 3 4 5 6 7 8 9 10
const Rx = require('rx');
const csv = require('csv-parse');
const fs = require('fs');
 
Rx.Node.fromReadableStream(fs.createReadStream('file.csv').pipe(csv()))
.skip(1)
.withLatestFrom(rows.take(1), (row, header) => {
// Map header[i] => row[i]
return row.reduce((rowObj, cell, i) => {
rowObj[header[i]] = cell;
View arkena.css
1 2 3 4 5 6 7 8 9 10
.playerContainer {
position: relative;
}
 
.playerContainer object {
height: 100%;
left: 0;
top: 0;
position: absolute;
width: 100%;
View index.js
1 2 3 4 5 6 7 8 9 10
var concat = require('concat-stream');
 
function parseCSV(file) {
var parser = csvParse({
delimiter: ',',
auto_parse: true,
columns: true
});
return new Promise(function(resolve, reject) {
View nodeswitch.sh
1 2
alias useio='ln -sf /usr/local/bin/iojs /usr/local/bin/node && node -v'
alias usenode='(brew unlink node && brew link --overwrite node) > /dev/null && node -v'
View index.js
1 2 3 4 5 6 7 8 9 10
var EventEmitter = require("events").EventEmitter;
 
function PathEmitter() {
window.addEventListener('popstate', this._emitNavigate.bind(this));
EventEmitter.call(this);
}
 
PathEmitter.prototype = new EventEmitter();
 
PathEmitter.prototype._emitNavigate = function _emitNavigate() {
View rxjs-autocomplete.js
1 2 3 4 5 6 7 8 9 10
// Based on https://github.com/Reactive-Extensions/RxJS/tree/master/examples/autocomplete
 
var Rx = require("rx-dom");
var querystring = require("querystring");
var jsonp = require("jsonp");
 
function searchWikipedia(term) {
return new Promise((resolve, reject) => {
 
var params = querystring.stringify({
View not-ok.js
1 2 3 4 5 6 7 8 9 10
(function () {
if (x && !(x + "1") && y) { // 1
var qq;
foo();
} else {
bar();
}
 
if (x || !!(x + "1") || y) { // 2
foo();
View keybase.md

Keybase proof

I hereby claim:

  • I am bjoerge on github.
  • I am bjoerge (https://keybase.io/bjoerge) on keybase.
  • I have a public key whose fingerprint is 1CB9 3D09 AAEA C6D9 8F54 B971 9944 8770 48FC 8B0D

To claim this, I am signing this object:

View stateful.js
1 2 3 4 5 6 7 8 9 10
var EventEmitter = require("events").EventEmitter;
 
// A thing to manage/track state changes
// Changes passed to setState are queued up and effectuated in the next event loop tick
class Stateful extends EventEmitter {
 
constructor() {
this.state = this.getInitialState();
this._stateChangeQueue = [];
this._stateChangeInProgress = false;
View promise.js
1 2 3 4 5 6 7 8
// Can you spot the bug? You will never se any errors in devtools/console when running this.
 
new Promise(function(reslove) {
resolve("Foo");
})
.then(function() {
console.log("Why is this never called?");
});
Something went wrong with that request. Please try again.