var formatter = new DateFormatter();
// get a formatting callback(date) -> string
var myChartSettings = {
tickFormatter: formatter.createCallbackUsing(DateFormatter.FULL_HOUR)
};
Some reading before it: https://gist.github.com/eliseumds/8f970d8929e61b981438
var requestManager = new RequestManager();
var request1 = myApi.get('/resource1');
var request2 = myApi.get('/resource2');
requestManager.addAll([request1, request2]);
This file contains hidden or 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
getXrange(data) { | |
const xRange = this.props.xRange | |
let max = -Infinity | |
let min = Infinity | |
if (xRange.max) { | |
max = xRange.max | |
} | |
if (xRange.min) { | |
min = xRange.min | |
if (xRange.pivotNumber) { |
This file contains hidden or 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 ReactDOM from 'react-dom'; | |
import isNumber from 'lodash/isNumber'; | |
import elementResizeDetector from 'element-resize-detector'; | |
let erd; | |
if (__CLIENT__) { | |
erd = elementResizeDetector({ | |
strategy: 'scroll' |
This file contains hidden or 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, { PureComponent, PropTypes } from 'react'; | |
import { connect } from 'react-redux'; | |
import { formValueSelector } from 'redux-form'; | |
/* | |
Example usage: | |
* Get the value of a single form field: | |
<FormValueSelector fieldName="phone"> |
I hereby claim:
- I am eliseumds on github.
- I am eliseumds (https://keybase.io/eliseumds) on keybase.
- I have a public key whose fingerprint is A769 D45E 5412 B851 7005 F236 E133 86CB DA8D D9B1
To claim this, I am signing this object:
This file contains hidden or 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 function serializeServerDataToJsonString(data: Object): string { | |
const jsonString = JSON.stringify(data); | |
return jsonString | |
.replace(/<\/script/gim, '</_escaped_script') | |
.replace(/<!--/gm, '\\u003C!--') | |
.replace(new RegExp('\u2028', 'g'), '\\u2028') | |
.replace(new RegExp('\u2029', 'g'), '\\u2029') | |
.replace(/\\/g, '\\\\') | |
.replace(/\n/g, '\\n') |
This file contains hidden or 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 machine = Machine({ | |
id: 'subscriptionFlow', | |
initial: 'pickingBrand', | |
context: { | |
value: 'pickingBrand', | |
}, | |
states: { | |
pickingBrand: { | |
on: { | |
PICK_BRAND: 'loadingBrand', |