This file contains 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 |
This file contains 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 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 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 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 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 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 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 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 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
A0aLHgAsVLeItEtEDaPkGKSWqdQzINMAXaPQNpF8U8E4oDqHotYRUnmnQmUgIaEOAtRCJA9VyERCykWiNqLwUSWNVImTlFpJSMhMADchdlL0k9RQUEcJqWqpSD2lmipcBWmrCoWvhERnCQnWElLlrQqluypU7VX+ishgFHEYajHBYxEmE3FZajOIzxSMVtFpVa1Woeg1IWm2KrcJsVvUb5LhkFiOeI7SdMl1Qm1H6jtQxqNI5wGyHpLsh6QeejGX4MICJuxiXidpXIv52d9w1swbOAf7kjpnAg/3ak4aRVy4vsqLeWcsvB61mmNUTX71Yt4ZC68nrFZzQ+cm+C3mpapF2MXcQBRYnaJ90on6Ks8vOm2LnjYDMMCc/ah6ptGasyg48bNhJvhqLqgsZrVwzE7UpxtW7K+v8hwwNPRcUFVKBMa534R54Sfqz4ZLYwmDYJH2BH49Ez1XwjE7UZ9uBsEifelvOGsm0LLmNH7iTqinyGIujJEyppiZgffBCLrRQGAKOIjUCJobxgAyA41o9IH5YAFBt2VZg0iNoDkZAzyFBk+BgCnQ4UaDUsypQaRG0Gou8vMXwSiLOftR9cz7tlaruYiim7CLufxowFQS+JzSERpJ29dLcPnRUBvGpHNxSkdoJG1fL8GlQA4C3XNKDIGwiKKbzEPDaft6CY4gF/UkTXhoGEBmBJceuDVHMBglhkBYqp8CQ37+IhgFUXSTOaUjNJK2r5fgUBvGpHNxSkdoJG1fL8GlQGYQvy3mOaVYlhJXqTyndIRGuPxoqA1j0rk4pSM0wqU36MBv4GEOoFQxCBZpRNFN5qFhAJkRXH401IYx6Vw8NAwgM4ID0eBcigZPzUVP5QYs/PcL0JzSERrh8qOhNoxJ5+KUjtAIv0EHfgMPc1eJjx/SWYwousk8NAwgM4LLj4baMCadi4eGAWRGcCCXosEPc1iBNaEwOVK58M9NEEU3mYeGufxoqA1j0rl4aJhbXHowzuVHQxlJcNcRZkvABFF0kzmlIzTC5UdD |
OlderNewer