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 waitForTimeout(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
function waitForIdle(timeout = 2000) { | |
return new Promise(resolve => { | |
if ('requestIdleCallback' in window) { | |
requestIdleCallback(resolve, { timeout }); | |
} else { | |
setTimeout(resolve, timeout); |
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 * as React from "react"; | |
import ReactDOM from "react-dom"; | |
import "./styles.css"; | |
import { useVirtual } from "../../../"; | |
function RowVirtualizerDynamic({ rows }) { | |
const parentRef = React.useRef(); |
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, { useReducer, useRef, useCallback, useLayoutEffect } from 'react' | |
import _ from 'lodash' | |
import ResizeObserver from 'resize-observer-polyfill' | |
import { assertNever } from 'lib/misc/Assert' | |
type DOMRectKeys = keyof DOMRectReadOnly | |
interface State<T extends DOMRectKeys> { | |
keys: T[] | |
value: Pick<DOMRectReadOnly, T> | undefined |
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
/** Used by Flavor to mark a type in a readable way. */ | |
export interface Flavoring<FlavorT> { | |
_type?: FlavorT; | |
} | |
/** Create a "flavored" version of a type. TypeScript will disallow mixing flavors, but will allow unflavored values of that type to be passed in where a flavored version is expected. This is a less restrictive form of branding. */ | |
export type Flavor<T, FlavorT> = T & Flavoring<FlavorT>; | |
/** Used by Brand to mark a type in a readable way. */ | |
export interface Branding<BrandT> { | |
_type: BrandT; |
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
#!/usr/bin/python | |
# coding=utf-8 | |
# "DATASHEET": http://cl.ly/ekot | |
from __future__ import print_function | |
import serial, struct, sys, time | |
DEBUG = 1 | |
CMD_MODE = 2 | |
CMD_QUERY_DATA = 4 | |
CMD_DEVICE_ID = 5 |
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
#!/usr/bin/python | |
# coding=utf-8 | |
# "DATASHEET": http://cl.ly/ekot | |
from __future__ import print_function | |
import serial, struct, sys, time | |
DEBUG = 1 | |
CMD_MODE = 2 | |
CMD_QUERY_DATA = 4 | |
CMD_DEVICE_ID = 5 |
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} from 'lib/vendor/react'; | |
import _ from 'lib/vendor/lodash'; | |
import {withContentRect} from 'lib/vendor/react-measure/Measure'; | |
import {pure, compose} from 'lib/vendor/recompose'; | |
type ComponentType<P = {}> = React.ComponentClass<P> | React.StatelessComponent<P>; | |
export type Breakpoint = | |
| 'small' |
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 * as React from 'react'; | |
import { Component } from 'react'; | |
export default function HOCBaseRender<Props, State, ComponentState>( | |
Comp: new() => Component<Props & State, ComponentState>) { | |
return class HOCBase extends Component<Props, State> { | |
render() { | |
return <Comp {...this.props} {...this.state}/>; | |
} | |
} |
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 from 'react'; | |
import TimePicker from 'rc-time-picker'; | |
import _ from 'lodash'; | |
import 'rc-time-picker/assets/index.css'; | |
import './CustomTime.scss'; | |
function maybe(fn, value) { | |
if (_.isFunction(fn)) { | |
fn(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 {React} from 'lib/vendor/react'; | |
import _ from 'lib/vendor/lodash'; | |
import Tooltip from 'lib/ui/Tooltip/Tooltip'; | |
import hashCode from 'lib/algorithms/hashCode'; | |
const EmptyString = ''; | |
const WhiteSpace = ' '; | |
const Dots = '...'; |
NewerOlder