Skip to content

Instantly share code, notes, and snippets.

import { call, spawn } from 'redux-saga/effects'
import { sagas as centreSagas } from './ducks/centres'
export default async function rootSaga() {
const sagas = [...centreSagas]
await sagas.map(saga =>
spawn(async function () {
console.log(saga);
let isSyncError = false
var PIBY2 = Math.PI / 2;
var ToDegrees = 180 / Math.PI;
var x = 50;
var y = 50;
var vx = Math.random() - 0.5;
var vy = Math.random() - 0.5;
function update() {
<Route path="/" component={App} onEnter={authenticate}>
<IndexRoute component={HomePage} />
<Route path="feedback" component={Feedback} />
<Route path="search(/:query)" component={HomePage} />
</Route>
import 'isomorphic-fetch'
import { test } from 'tap'
import nock from 'nock'
nock('http://localhost')
.get(/item\/(.*)/)
.times(2)
.reply(200, function(url, requestBody) {
const user = url.substr(url.lastIndexOf('/') + 1)
return `You found user ${user}`
TypeError: Cannot read property 'done' of undefined
at next (/Users/dm/cc/react-app/node_modules/co/index.js:98:14)
at onFulfilled (/Users/dm/cc/react-app/node_modules/co/index.js:69:7)
at /Users/dm/cc/react-app/node_modules/co/index.js:54:5
at Object.co (/Users/dm/cc/react-app/node_modules/co/index.js:50:10)
at Object.toPromise (/Users/dm/cc/react-app/node_modules/co/index.js:118:63)
at next (/Users/dm/cc/react-app/node_modules/co/index.js:99:29)
at onFulfilled (/Users/dm/cc/react-app/node_modules/co/index.js:69:7)
function setRefunderOnRefund(historyItem) {
historyItem.refunds.forEach(async refund => {
const { requesterId } = refund
if (staff[requesterId]) {
refund.requester = staff[requesterId]
} else {
const requester = await findStaffById(requesterId)
refund.requester = (requester.firstName.charAt(0) + requester.lastName).toLowerCase()
staff[requesterId] = refund.requester
}
export async function findStaffById(id) {
if (staff[id]) {
return staff[id]
}
const url = endpoint(id).clone()
const data = await secureFetch(url)
staff[id] = camelify(data)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
12:03:39 PM web.1 | [nodemon] restarting due to changes...
12:03:39 PM web.1 | [nodemon] restarting due to changes...
12:03:39 PM web.1 | [nodemon] starting `node index.js`
12:03:39 PM web.1 | [nodemon] restarting due to changes...
12:03:39 PM web.1 | [nodemon] restarting due to changes...
12:03:39 PM web.1 | [nodemon] starting `node index.js`
12:03:39 PM web.1 | [nodemon] restarting due to changes...
12:03:39 PM web.1 | [nodemon] starting `node index.js`
12:03:39 PM web.1 | [nodemon] restarting due to changes...
12:03:39 PM web.1 | [nodemon] restarting due to changes...
@marr
marr / Label.js
Last active August 30, 2016 07:08
import classnames from 'classnames'
import React, { Component, PropTypes } from 'react'
class Label extends Component {
static propTypes = {
input: PropTypes.object.isRequired,
meta: PropTypes.object.isRequired
};
render() {