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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| var classNames = require('classnames') | |
| var Col = require('react-bootstrap/lib/Col') | |
| var React = require('react') | |
| var Row = require('react-bootstrap/lib/Row') | |
| var {PropTypes} = React | |
| var Help = require('./Help') | |
| var Loading = require('./Loading') | |
| var FIELD_EVENT_HANDLER = /^(?:on|handle)[A-Z]/ |
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
| // Also available as a NPM library: https://github.com/ajwhite/render-if | |
| 'use strict'; | |
| const isFunction = input => typeof input === 'function'; | |
| export default predicate => elemOrThunk => | |
| predicate ? (isFunction(elemOrThunk) ? elemOrThunk() : elemOrThunk) : null; | |
| import renderIf from '../utils/renderif' | |
| export default class RenderIfExample extends Component { |
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 default class SetValueExample extends React.Component { | |
| constructor() { | |
| super(); | |
| this.state = { | |
| myName: '', | |
| }; | |
| } | |
| setValue(e) { | |
| this.setState({[e.target.name]: e.target.value}); |
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 datetime | |
| import pickle | |
| import warnings | |
| import math | |
| from hmmlearn.hmm import GaussianHMM, GMMHMM | |
| from matplotlib import cm, pyplot as plt | |
| from matplotlib.dates import YearLocator, MonthLocator | |
| import numpy as np | |
| import pandas as pd | |
| import seaborn as sns |
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
| @function strip-units($number) { | |
| @return $number / ($number * 0 + 1); | |
| } | |
| // increases margin-bottom if font size is greater than 20px | |
| @function double-size($fontSize, $marginNumber) { | |
| @if strip-units($fontSize) > 20 { | |
| @return $marginNumber * 1; | |
| } @else { | |
| @return $marginNumber; |