Skip to content

Instantly share code, notes, and snippets.

var github = require('github-basic');
var client = github({
version: 3,
auth: process.argv[2],
cache: 'file',
sync: true
});
function forEach(page, fn) {

I really like the idea behind this. I get totally addicted to the "games" that look like this and just require you to keep checking on them every now and then to collect new buildings/powerups etc. I'm embarrased by how long I played sim-city build it on my phone. I also really need to focus more when I work, so this seems like the perfect sollution.

My initial thoughts:

  1. It's not obvious from either the main page, or the button that the focus session is in progress until you notice that the progress is being indicated. It would be great to have some clear text on the "Build Focus" app/page that says something like "Focus Session in Progress".
  2. There was no way to manually indicate that I had "taken a break" because the buttons are disabled during focus time.
This message has come out garbled when I've tried it in the past:
```js
function foo() {
return 10;
}
```
@ForbesLindesay
ForbesLindesay / README.md
Created April 10, 2015 23:13
Promise vs. Bluebird for react-native

I ran this benchmark for react-native with both bluebird and promise to compare the two.

I think it's worth noting that the margin for error on this benchmark is significant. I do not attempt to claim that Promise is actually faster than Bluebird, but I do claim that the gap between them is small enough to make performance an irrelevant consideration when deciding which one to use.

Bluebird summary:

#ofRuns:  100
Average: 2501.6 ms
Median: 2354.5 ms

Jade Pipeline

Options:

  • resolve(filename, source) => filename
  • read(filename) => string

Steps:

  1. pre-lex
FROM centos:centos6
RUN yum -y update
RUN yum -y groupinstall "Development Tools"
RUN yum install -y wget
RUN yum install -y tar
RUN cd /usr/src && wget https://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz && \
tar zxf node-v0.12.0-linux-x64.tar.gz && \
cp -rp node-v0.12.0-linux-x64 /usr/local/ && \
'use strict';
var Map = require('es6-map');
var Set = require('es6-set');
function Object() {
this.props = new Map();
this.propogatedTo = [];
this.assignedTo = new Set();
this.propogatedFrom = [];
@ForbesLindesay
ForbesLindesay / .file-test.js
Last active August 29, 2015 14:10
.file-test.js
'use strict';
var assert = require('assert');
var read = require('fs').readFileSync;
var write = require('fs').writeFileSync;
var fileTest = require('file-test');
var parse = require('../');
function parseNewlineJson(src) {
return src.split('\n').filter(Boolean).map(JSON.parse);
function promiseAll(promises) {
return promises.reduce(function (accumulator, promise) {
return accumulator.then(function (accumulator) {
return promise.then(function (value) {
accumulator.push(value);
return accumulator;
});
}, Promise.resolve([]));
};

Asset Key Spec

Asset key is a specification for defining a common API for all compilable languages.

compiler.compile(src, options) => Promise({body: string, type: string, dependencies: []})

Compiles a string with some options and returns a promise for an asset. This should never attempt to implement any caching internally, regardless of options passed in.

If the transform requires a filename, this method should not be implemented.