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": { | |
"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
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
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
import React from 'react' | |
import { View, TextInput, } from 'react-native' | |
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
// Reducer.js | |
const initialState = { | |
user: { | |
email: null, | |
name: null, | |
}, | |
myForm: { // define our form in advance | |
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
import React, { Component } from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
} from 'react-native'; | |
import Camera from 'react-native-openalpr'; | |
const styles = StyleSheet.create({ | |
container: { |
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
let containerId | |
module.exports.hello = (event, context, callback) => { | |
if (!containerId) containerId = context.awsRequestId | |
console.log(containerId) | |
callback(null, { | |
statusCode: 200, | |
body: JSON.stringify({ |
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 california = { | |
'acalanes-ridge': | |
{ name: 'Acalanes Ridge', | |
id: 'acalanes-ridge', | |
stateAbbr: 'CA', | |
state: 'California' }, | |
acampo: | |
{ name: 'Acampo', | |
id: 'acampo', | |
stateAbbr: 'CA', |