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
| [] |
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
| { | |
| "version": "0.0.1", | |
| "type": "project", | |
| "variant": "monorepo", | |
| "structure": [ | |
| [ | |
| "Tiles", | |
| { | |
| "type": "react-component", | |
| "name": "Tiles", |
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
| { | |
| "version": "0.0.1", | |
| "type": "project", | |
| "variant": "monorepo", | |
| "structure": [ | |
| [ | |
| "test-folder/components/Counter2", | |
| { | |
| "type": "react-component", | |
| "name": "Counter", |
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
| // O(1) | |
| const todo = (state, action) => { | |
| const actions = { | |
| ADD_TODO: () => { | |
| return { | |
| id: action.id, | |
| text: action.text, | |
| completed: false | |
| } | |
| }, |
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 } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { accessor } from 'react-big-calendar/lib/utils/accessors'; | |
| import { accessor as accessorPropType } from 'react-big-calendar/lib/utils/propTypes'; | |
| import { noop } from 'lodash'; | |
| import { zonedToLocal, localToZoned } from '/client/utils/timezones'; | |
| import { hasTime, shiftDate, shiftHour } from '/client/utils/date'; | |
| /** | |
| * withTimeZone - HOC to add time zone support to react-big-calendar |
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 chalk = require('chalk'); | |
| const getHrDiffTime = time => { | |
| // ts = [seconds, nanoseconds] | |
| const ts = process.hrtime(time); | |
| // convert seconds to miliseconds and nanoseconds to miliseconds as well | |
| return ts[0] * 1000 + ts[1] / 1000000; | |
| }; | |
| const outputDelay = (interval, maxDelay) => { |
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
| /* | |
| what it does: | |
| Wraps objects to respond to data path strings separated by '/' | |
| ex: vpFoo['path/to/0/property'] <= same as => foo.path.to[0].property | |
| usage: | |
| const foo = { | |
| bar: 12, | |
| something: [ | |
| { baz: 14 } | |
| ] |
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 cssRegex = /([*="'.#():[*^$~\\|>+,\w\]\s\-]*?(?![^{]*\}))[\s\n]?[{,]/gm; |
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 isPromise = obj => Boolean(obj) && typeof obj.then === 'function'; | |
| const next = (iter, callbacks, prev = undefined) => { | |
| const { onNext, onCompleted } = callbacks; | |
| const item = iter.next(prev); | |
| const value = item.value; | |
| if (item.done) { | |
| return onCompleted(); | |
| } |
NewerOlder