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 cypress = require('cypress'); | |
| const { DateTime } = require('luxon'); | |
| const { green, white, yellow, red } = require('chalk'); | |
| const glob = require('glob'); | |
| const RUNTIME_MINUTES_GOOD = 6; | |
| const RUNTIME_MINUTES_OKAY = 10; | |
| const BASE_DIRECTORY = 'cypress/tests/integration'; | |
| /** |
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 { resolve } = require('path'); | |
| const { readdir, rename } = require('fs').promises; | |
| const DIRECTORY = 'src'; | |
| async function* getFiles(dir) { | |
| const dirents = await readdir(dir, { withFileTypes: true }); | |
| for (const dirent of dirents) { | |
| const res = resolve(dir, dirent.name); | |
| if (dirent.isDirectory()) { |
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 const Screen: React.FC = () => { | |
| useIdleTimer({ | |
| idleMs: 30 * 60000, | |
| warningBeforeIdleMs: 25 * 60000, | |
| onWarning: () => console.log('pop warning dialog'), | |
| onIdle: async () => { | |
| console.log('close warning dialog, sign the user out, etc'); | |
| }, | |
| }); | |
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 { debounce } from 'lodash'; | |
| import { useCallback, useRef } from 'react'; | |
| type Callback = (...args: any[]) => void; | |
| /** | |
| * Create the memoized / debounced function one time. | |
| * | |
| * This stores the current instance of the function to be debounced in a ref and updates | |
| * it every render (preventing stale data). Instead of debouncing that function directly we |
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 const MyComponent: React.FC = () => { | |
| useKeyBinds({ | |
| "ctrl+z": () => { | |
| console.log('undo'); | |
| }, | |
| "ctrl+y": () => { | |
| console.log('redo'); | |
| }, | |
| }); |
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
| type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }; | |
| export type XOR<T, U> = T | U extends object | |
| ? (Without<T, U> & U) | (Without<U, T> & T) | |
| : T | U; | |
| export type PaddingValue = | |
| | number | |
| | `${number}px` | |
| | `${number}em` |
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 { PaletteColor, RgbString } from "../Theme"; | |
| export type RGB = [number, number, number]; | |
| type BackgroundColor = string; | |
| export function getRedGreenBlue(rgbStr: string): RGB { | |
| const [r, g, b] = /rgba?\((.+)\)/ | |
| .exec(rgbStr)[1] | |
| .split(",") | |
| .map((c) => Number(c.trim())); |
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
| #!/bin/sh | |
| main() { | |
| usage() { echo "Usage: $0 [-d <string*>] [-t <string*>] [-u <string*>] [-p <string*>] [-h <string>] [-m <number>]" 1>&2; exit 1; } | |
| while getopts ":h:d:t:u:p:m:" o; do | |
| case "${o}" in | |
| u) | |
| u=${OPTARG} | |
| ;; |
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
| FROM node:12-alpine | |
| WORKDIR /app | |
| COPY tsconfig.json ./ | |
| COPY serverless.yml ./ | |
| COPY package.json ./ | |
| COPY package-lock.json ./ | |
| RUN npm ci |
NewerOlder