This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsdomGlobal from 'jsdom-global' | |
import jsdom from 'jsdom' | |
import localStorage from 'localStorage' | |
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>') | |
const win = doc.defaultView | |
win.localStorage = localStorage | |
global.document = doc | |
global.window = win | |
jsdomGlobal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsdomGlobal from 'jsdom-global' | |
import jsdom from 'jsdom' | |
import localStorage from 'localStorage' | |
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>') | |
const win = doc.defaultView | |
win.localStorage = localStorage | |
global.document = doc | |
global.window = win | |
jsdomGlobal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:export { | |
className: 'composedHashedClassName hashedClassName'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import d3 from 'd3' | |
import css from './index.css' | |
const rawData = [{'date':'2016-01-06','hours':2.7},{'date':'2016-01-07','hours':1.735},{'date':'2016-01-08','hours':0.5219},{'date':'2016-01-09','hours':0.0},{'date':'2016-01-10','hours':0.0},{'date':'2016-01-11','hours':2.2708},{'date':'2016-01-12','hours':1.2692},{'date':'2016-01-13','hours':0.2219},{'date':'2016-01-14','hours':3.2722},{'date':'2016-01-15','hours':0.3353},{'date':'2016-01-16','hours':0.5389},{'date':'2016-01-17','hours':0.0},{'date':'2016-01-18','hours':1.3308},{'date':'2016-01-19','hours':2.1228},{'date':'2016-01-20','hours':1.0539},{'date':'2016-01-21','hours':0.0},{'date':'2016-01-22','hours':1.2525},{'date':'2016-01-23','hours':1.8133},{'date':'2016-01-24','hours':1.9583},{'date':'2016-01-25','hours':3.3772},{'date':'2016-01-26','hours':0.9175},{'date':'2016-01-27','hours':0.4208},{'date':'2016-01-28','hours':0.0},{'date':'2016-01-29','hours':1.1847},{'date':'2016-01-30','hours':0.0175},{'date':'2016-01-31','hours':0.49},{'date':'2016-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function keepTrying(otherArgs, promise) { | |
promise = promise||new Promise(); | |
// try doing the important thing | |
if(success) { | |
promise.resolve(result); | |
} else { | |
setTimeout(function() { | |
keepTrying(otherArgs, promise); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mockPromises from 'mock-promises' | |
// it should something | |
mockPromises.reset() | |
Promise = mockPromises.getMockPromise(Promise) | |
const reqPromise = new Promise((resolve, reject) => { | |
resolve(res) | |
}) | |
sinon.stub(fetchCurrentUser, 'request', () => reqPromise) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fnEs6Style = () => { | |
return 1 | |
} | |
var fnNoParens = num => { | |
return 2 | |
} | |
var fnImplicitReturnParens = () => 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
class Comp { | |
componentDidMount() { | |
console.log('Comp - I mounted!') | |
} | |
componentWillUnmount() { | |
console.log('Comp - My time has come') | |
} | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node - bin to run things | |
npm - bin to install things | |
npm init - start new node project | |
package.json - describing your project; your dependencies | |
npm install packageName - install things | |
npmjs.com - all the libs | |
REST API - noun - resource; verb - action | |
endpoint GET /books; POST /books | |
lib - expressjs.com - npm install express |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install autobind-decorator --save-dev |