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
//LOGIN VIEW | |
import { | |
initRememberMe, | |
toggleRememberMe | |
} from './login_actions' | |
class LoginForm extends Component { | |
componentWillMount() { | |
this.props.initRememberMe() | |
} |
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
// CAPITALIZE WORD | |
// ie: Capitalize the first letter | |
const word = 'capitalized' | |
const capitalize = word => [word] | |
.map(letter => letter.slice(0,1).toUpperCase() + letter.slice(1)) | |
.toString() | |
console.log( | |
'Look mom:', |
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 * as THREE from 'three' | |
// import * as OBJLoader from 'three-obj-loader' | |
// import MTLLoader from 'three-react-mtl-loader' | |
// import OBJLoader from 'three-react-obj-loader' | |
// const loader = require('three-json-loader')(THREE) | |
const OrbitControls = require('three-orbit-controls')(THREE) | |
// OrbitControls: for Camera |
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
// INCLUDING AWAIT DELEGATES TO PARENT | |
const dontBubbleUp = async () => { | |
const samplerPack = async () => { | |
throw new Error('BAD') | |
} | |
try { | |
return await samplerPack() | |
} catch (e) { | |
throw new Error('handling rejection upstream in parent') | |
} |
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
{ | |
"env": { | |
"node": true, | |
"browser": true, | |
"es6": true | |
}, | |
"parser": "babel-eslint", | |
"extends": "airbnb", | |
"parserOptions": { | |
"ecmaFeatures": { |
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 axios = require('axios') | |
const followIDs = async (next) => { | |
if (next) { | |
const nextRes = await axios({ | |
method: 'get', | |
url: next, | |
responseType: 'json' | |
}) | |
if (nextRes.data.message) { |
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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"parser": "babel-eslint" | |
}, | |
"extends": [ |
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
// First we are creating or getting some users and placing them in `users` | |
const users = [ | |
{ name: 'Bob' }, | |
{ name: 'Alice' }, | |
] | |
// Then we are creating a config object that we could pass around as needed | |
// Notice we are using shorthand `users` instead of `users: users` | |
const config = { | |
appOwner: 'INSERT_YOUR_NAME', |
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 showTimeElapsed = (timestamp) => { | |
if (typeof timestamp !== 'number') return 'NaN' | |
const SECOND = 1000 | |
const MINUTE = SECOND * 60 | |
const HOUR = MINUTE * 60 | |
const DAY = HOUR * 24 | |
const MONTH = DAY * 30 | |
const YEAR = MONTH * 12 |
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 data = [ | |
{ first: 'David', last: 'Goldstein', age: 92 }, | |
{ first: 'Tom', last: 'Stamper', age: 23 }, | |
{ first: 'Sally', last: 'Brunswick', age: 76 }, | |
{ first: 'Steve', last: 'Henderson', age: 37 }, | |
{ first: 'Mark', last: 'Chopper', age: 75 }, | |
{ first: 'Lucy', last: 'Steel', age: 29 }, | |
] | |
// localeCompare is a String prototype: |
OlderNewer