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 convertTo(type, data) { | |
switch(type) { | |
case 'hex': | |
case 'string': | |
return Buffer.from(data).toString('hex') | |
case 'buffer': | |
case 'Uint8Array': | |
return Buffer.from(data, 'hex') | |
} |
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
// start.js | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { hot } from 'react-hot-loader' | |
const App = () => <div>Hello World!! 4</div> | |
const HotApp = hot(module)(App) | |
ReactDOM.render(<HotApp />, document.getElementById('root')) |
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
// start.js | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { hot } from 'react-hot-loader' | |
export default function start() { | |
const App = () => <div>Hello World!! 4</div> | |
const HotApp = hot(module)(App) |
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
/* | |
Utility to analyze bundle chunks over versions. | |
Assumes: webpack has already created the bundle summary json file -> stats.json | |
Parameters: | |
version: (Optional) a string that labels the current bundle with the version | |
provided and saves the summary in a csv file. | |
Output: | |
If run the first time, generates a csv file bundleAnalaysis.csv, which |
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
#!/usr/bin/env node | |
/* | |
Usage: | |
Install all production depenencies to their current version: ~/npm/install --prod | |
Install all production depenencies to their latest: ~/npm/install --prod --latest | |
Install all production depenencies to their latest and update package.json: ~/npm/install --prod --latest --save | |
Install all development depenencies to their current version: ~/npm/install --dev |
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
export default function pluginInterface(props = {}) { | |
const Model = modelInterface(props.Model) | |
const Controller = controllerInterface(props.Controller, Model) | |
const ChargeModel = chargeModelInterface(Model) | |
const ChargeController = chargeControllerInterface(Controller, ChargeModel) | |
return [ | |
{ |
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
convertDateToDatabaseTime4(d) { | |
var date = (d) ? moment(d) : moment(), | |
year = parseInt(date.format('YYYY')), | |
month = parseInt(date.format('M')), | |
day = parseInt(date.format('D')) | |
return r.time(year, month, day, '-04:00') | |
} | |
convertDateToDatabaseTime7(year, month, day, hour = 0, minute = 0, second = 0, timezone = '-04:00') { |
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 times = { | |
// Last day available to register | |
end: { | |
'James': r.time(2016, 7, 3, '-04:00'), | |
'John': r.time(2016, 7, 2, '-04:00') | |
}, | |
// First day available to register | |
start: { | |
'James': r.time(2016, 7, 2, '-04:00'), | |
'John': r.time(2016, 7, 1, '-04:00') |
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
{ | |
"indexes": [ | |
"minute" | |
], | |
"primary_key": "id", | |
"schema": { | |
"close": { | |
"default": 0, | |
"null": false | |
}, |
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
// minutes | |
[{"close":31.67,"date":"2016-06-02","high":31.67,"id":"AAL-0-2016-06-02","low":31.67,"minute":0,"open":31.67,"symbol":"AAL","volume":67512},{"close":30.78,"date":"2016-06-06","high":30.78,"id":"AAL-0-2016-06-06","low":30.77,"minute":0,"open":30.77,"symbol":"AAL","volume":64594},{"close":31.94,"date":"2016-06-01","high":31.94,"id":"AAL-0-2016-06-01","low":31.94,"minute":0,"open":31.94,"symbol":"AAL","volume":97778},{"close":32.25,"date":"2016-06-09","high":32.3,"id":"AAL-0-2016-06-09","low":32.25,"minute":0,"open":32.25,"symbol":"AAL","volume":60465},{"close":31.55,"date":"2016-06-03","high":31.59,"id":"AAL-0-2016-06-03","low":31.55,"minute":0,"open":31.59,"symbol":"AAL","volume":79261},{"close":31.35,"date":"2016-06-07","high":31.48,"id":"AAL-0-2016-06-07","low":31.35,"minute":0,"open":31.46,"symbol":"AAL","volume":47844},{"close":31.86,"date":"2016-06-14","high":31.87,"id":"AAL-1-2016-06-14","low":31.7,"minute":1,"open":31.81,"symbol":"AAL","volume":68979},{"close":32.67,"date":"2016-06-08","high |