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 interestSurcharge = new Set(['AL']); | |
const flagshipOriginationFee = new Set(['AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
'ID', 'IA', 'KS', 'KY', 'LA', 'ME', 'MS', 'MO', 'NM', 'ND', 'OH', 'OR', | |
'RI', 'SC', 'SD', 'UT', 'VA', 'WV', 'WI', 'WY']); | |
const documentPreparation = new Set(['IL']); | |
const nonrefundablePrepaidFinanceCharge = new Set(['IN']); | |
const notApplicable = new Set(['MD', 'MA', 'MN', 'MT', 'NV', 'NH', 'NJ', 'NY', 'NC', 'PA', 'VT']); | |
| |
const feeNameMap = new Map([ |
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 MAX_BATCH_SIZE = 10; | |
const WAIT_TIME_MS = 1000; | |
const makeRequest = async (id) => { | |
try { | |
await fetch(`/api/${id}`) | |
} catch(error) { } | |
} | |
const batchesOfIds = _.chunk(Ids, MAX_BATCH_SIZE); |
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
/* | |
* Component for displaying an experiment and bucket(s) | |
*/ | |
/******************************* | |
* Option 1a - prop renders based on bucket names, ~ mimics <Flag /> | |
*/ | |
<Experiment | |
name="exp:test-message" | |
bucketA={({ recordInteraction }) => (<Message color="blue" onClick={() => recordInteraction('click')}>Welcome!</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
/* | |
* "restify": "^7.2.0", | |
* "http-proxy": "^1.17.0", | |
* | |
* The restify server will proxy requests that match keys in a `proxies` config. | |
* | |
*/ | |
const restify = require('restify'); | |
const httpProxy = require('http-proxy'); |
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
/* | |
* # 1 | |
* HOC for retrieving and setting a featureFlag prop | |
*/ | |
const withFlag = (name) => compose( | |
connect((state) => { | |
const value = featureFlagSelector(state, { featureFlag }); | |
return { featureFlag, featureFlagValue }; |
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 createClientXY(x, y) { | |
return { clientX: x, clientY: y }; | |
} | |
export function createStartTouchEventObject({ x = 0, y = 0 }) { | |
return { touches: [createClientXY(x, y)] }; | |
} | |
export function createMoveTouchEventObject({ x = 0, y = 0}) { | |
return { changedTouches: [createClientXY(x, y)] }; |
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 EventComponent from './EventComponent'; | |
import { mount } from 'enzyme'; | |
import { | |
createStartTouchEventObject, | |
createMoveTouchEventObject | |
} from './EventHelpers.js'; | |
describe('EventComponent', () => { |
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 default class EventComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this._onTouchStart = this._onTouchStart.bind(this); | |
this._onTouchMove = this._onTouchMove.bind(this); | |
this._onTouchEnd = this._onTouchEnd.bind(this); |
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
# ------------------------------------------------------------------- | |
# Git | |
# ------------------------------------------------------------------- | |
alias ga='git add' | |
alias gp='git push' | |
alias gl='git log' | |
alias gs='git status' | |
alias gm='git commit -m' | |
alias gb='git branch' | |
alias gc='git checkout' |
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, PropTypes } from 'react'; | |
import { setPropTypes, withState, lifecycle, mapProps, compose } from 'recompose'; | |
export const ImageComponent = compose( | |
setPropTypes({ src: PropTypes.string.isRequired }), | |
withState('imgState', 'updateImgState', ({ src }) => ({ origSrc: src, currentSrc: src })), | |
lifecycle({ | |
componentWillReceiveProps(nextProps) { | |
// if Image components src changes, make sure we update origSrc and currentSrc | |
if (nextProps.src !== nextProps.imgState.origSrc) { |
NewerOlder