Skip to content

Instantly share code, notes, and snippets.

// Press ctrl+space for code completion
export default function transformer(file, api) {
const j = api.jscodeshift;
let source = file.source;
let root = j(source);
// remove "use strict"
root.find(j.ExpressionStatement).filter(path => (
path.value.expression.type === 'Literal' &&

Making a CMS using Heroku, GitHub, node.js and React

Create a repository to be hold static website/content (done)

This repo will ultimately contain all the templates and code needed to render your website. It should deploy to Amazon S3 using travis. You can follow the instructions on https://simplestaticsite.org/ to get started.

Define Content Types

In the static repository, create a folder called "content". In this folder you can define each of the content types.

// assume that the optimiser doesn't know the base promise is never resolved
let resolve, reject;
const base = new Promise((_resolve, _reject) => {resolve = _resolve; reject = _reject;});
const end = new Promise(resolve => {
const middlePromise = new Promise(resolve => {
setTimeout(() => resolve(base), 1000);
});
resolve(middlePromise);
});
module.exports = {
parser: 'babel-eslint',
rules: {
// possible errors
'comma-dangle': [2, 'always-multiline'],
'no-constant-condition': [2],
'no-control-regex': [2],
'no-debugger': [2],
'no-dupe-args': [2],
'no-dupe-keys': [2],
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/ && \