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' | |
export class Form extends React.PureComponent { | |
constructor(props) { | |
super(props) | |
this.state = { | |
input1: null, | |
input2: null, | |
} | |
} |
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
class MockDynamoDB { | |
constructor() { | |
this.tables = {} | |
} | |
get(params, callback) { | |
/** if table does not exist, return with an error */ | |
if (!this.tables[params.TableName]) callback({ message: 'no items in table', }, null) | |
else { | |
const key = Object.keys(params.Key)[0] // e.g. user_id |
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
"scripts": { | |
"test": "sh test.sh", | |
"watch": "sh watch.sh", | |
"cover": "sh cover.sh", | |
"deploy": "sh deploy.sh", | |
"build": "sh build.sh" | |
} |
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
"scripts": { | |
"start": "node server.js", | |
"test": "mocha test/ --recursive" | |
} |
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
"scripts": { | |
"start": "node server.js", | |
"cover": "nyc -x '**/*spec.js' -n 'app' -r text -r html -r lcov npm test", | |
"test": "mocha --compilers js:babel-register -r babel-polyfill -r whatwg-fetch -r jsdom-global/register -r .test-setup.js -R spec app/**/spec.js app/**/*spec.js app/redux/actions/*spec.js", | |
"test:watch": "npm test -- --watch", | |
"prodbuild": "webpack -p --config ./webpack.prod.config.js" | |
}, |
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' | |
import { View, Text, TouchableOpacity, } from 'react-native' | |
import style from './style' | |
const pipe = (fns, init) => fns.reduce((acc, fn) => fn(acc), init) | |
const monthLabels = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |
const getDaysInMonth = (month, year) => { | |
if (month === 1) { |
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 const makes = { | |
"makes": [{ | |
"id": "279a091a-32c1-46c7-80d2-b3423320f18f", | |
"name": "AM General" | |
}, { | |
"id": "72cadfa6-e1c0-4507-9bdd-835f93951dd6", | |
"name": "Acura" | |
}, { | |
"id": "02a97e0d-eb73-48e3-898a-567a3c81c0ee", | |
"name": "Alfa Romeo" |
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
const formatData = data => { | |
// We're sorting by alphabetically so we need the alphabet | |
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); | |
// Need somewhere to store our data | |
const dataBlob = {}; | |
const sectionIds = []; | |
const rowIds = []; | |
// Each section is going to represent a letter in the alphabet so we loop over the alphabet |
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
const makesModels = { | |
"Acura": { | |
"ILX": { | |
"years": [ | |
2016, | |
2015, | |
2014, | |
2013, | |
2012 | |
] |