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 measurementsData = require('./measurements.json'); | |
const newData = measurementsData.table.measurements.reduce((acc, val, idx) => { | |
acc.labels.push(val.name); | |
val.sizes.forEach((d, i) => { | |
let row = acc.data.find(r => r[0] === d.name); | |
if (!row) { | |
acc.data.push([d.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
var React = require('react/addons'), | |
Bootstrap = require('react-bootstrap'), | |
Formsy = require('formsy-react'); | |
var InputValidate = React.createClass({ | |
mixins: [Formsy.Mixin, React.addons.PureRenderMixin], | |
getDefaultProps: function () { | |
return { | |
autocomplete: 'off', |
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 doc = app.activeDocument; | |
try { | |
if (app.documents.length > 0) { | |
var exportOpts = new ExportOptionsSVG(); | |
if (doc.saved == false) { | |
doc.save(); | |
} |
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 { autobind } from 'core-decorators'; | |
import { HOC } from 'formsy-react'; | |
import { Input } from 'components/Input'; | |
@autobind | |
export class InputValidate extends React.Component { | |
constructor(props) { | |
super(props); |
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
{ | |
"ecmaFeatures": { | |
"arrowFunctions": true, | |
"blockBindings": true, | |
"classes": true, | |
"defaultParams": true, | |
"destructuring": true, | |
"modules": true, | |
"objectLiteralComputedProperties": true, | |
"objectLiteralShorthandMethods": true, |
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 comparator(data: Object, nextData: Object): Object { | |
return { | |
changedFrom(key: string, actual: 'string', prev: string): boolean { | |
return data[key] === prev && nextData[key] === actual; | |
}, | |
changedTo(key: string, actual: 'string'): boolean { | |
return data[key] !== actual && nextData[key] === actual; | |
}, | |
changed(key: string): boolean { | |
return data[key] !== nextData[key]; |
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 React = require('react'); | |
const PropTypes = require('prop-types'); | |
class Component extends React.Component { | |
render() { | |
return React.createElement('h1', {}, 'Component!'); | |
} | |
} | |
Component.propTypes = { |
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 validateURI(input: string): boolean { | |
let isValid = false; | |
if (input && input.indexOf(':') > -1) { | |
const [key, type, id] = input.split(':'); | |
if (key && type && id && id.length === 22) { | |
isValid = true; | |
} | |
} |
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
interface IOptions { | |
predicate: (child: React.ReactChild) => boolean; | |
props: { [key: string]: any }; | |
} | |
function mapReactChildrenRecursively(children: React.ReactNode, options: IOptions): React.ReactNode { | |
if (!options.predicate || !options.props) { | |
return children; | |
} |
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 { Router } from 'react-router-dom'; | |
import createBrowserHistory from 'history/createBrowserHistory'; | |
const LOCATION_CHANGE = '@@router/LOCATION_CHANGE'; | |
export const history = createBrowserHistory(); | |
class ReduxRouter extends React.Component { | |
static propTypes = { |