Skip to content

Instantly share code, notes, and snippets.

const TIMEOUT = 500
patterns = {
's-r': [83, 82]
}
handler = e => {
// console.log(e.which)
clearTimeout(handler.timer)
handler.keys[e.which] = true
@anyley
anyley / dateTimeRangeCalc.js
Last active July 11, 2018 05:19
date time range calculator
export const writeEnums = (n, words, { zero = false, space = ' ' } = {}) => {
if (!zero && n === 0) return ''
const i10 = n % 10
const i100 = n % 100
if (i10 === 1 && i100 !== 11) {
return `${n}${space}${words[0]}`
} else if (i10 !== 0 && i100 !== 0 && i100 !== 11 && (i100 > 21 || i100 < 5) && i10 < 5) {
return `${n}${space}${words[1]}`
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Modal from '@material-ui/core/Modal';
import Button from '@material-ui/core/Button';
function rand() {
return Math.round(Math.random() * 20) - 10;
}
import { createActions } from 'redux-actions';
const {
auth: {
sendCode,
sendCodeSuccess,
sendCodeError,
checkCode,
checkCodeSuccess,
checkCodeError,