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
| gh gist list --limit 1000 | |
| find . -name '' -type f |
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 and related utilities for dealing with nil or "falsy" values in Typescript | |
| // Credits: | |
| // • You Don't Know Javascript by Kyle Simpson [Book] | |
| // • Javascript – The Good Parts by Douglas Crockford [Book] | |
| /** | |
| * Value which behaves the same as `false` when evaluated. | |
| */ | |
| export type Nil = undefined | null | false | 0 | -0 | typeof NaN | ""; |
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
| /** | |
| * Transform an object const map into a literal union. | |
| * | |
| * @example | |
| * const Colors = { | |
| * Red = "red", | |
| * Green = "green", | |
| * Blue = "blue", | |
| * } as const; | |
| * |
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 MapOfArrays< | |
| TKey extends string | number | symbol, | |
| TArrayItem, | |
| TArray extends RelativeIndexable<TArrayItem>, | |
| > = Partial<Record<TKey, TArray>>; | |
| type ReadonlyMapOfArrays< | |
| TKey extends string | number | symbol, | |
| TArrayItem, | |
| > = MapOfArrays<TKey, TArrayItem, ReadonlyArray<TArrayItem>>; |
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 { get, omit } from "lodash"; | |
| import { ComponentType } from "react"; | |
| export function createWithHOC<THOCProps, THOCName extends string>( | |
| HOC: ComponentType<THOCProps>, | |
| hocName: THOCName, | |
| ) { | |
| return function withHOC<TLOCProps extends JSX.IntrinsicAttributes>( | |
| LOC: ComponentType<TLOCProps>, | |
| ) { |
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
| { | |
| "tabWidth": 2, | |
| "useTabs": false, | |
| "singleQuote": false, | |
| "importOrder": ["^[@]?[a-zA-Z]", "^[@/a-zA-Z]", "^../", "^./"], | |
| "importOrderSeparation": true, | |
| "importOrderSortSpecifiers": true, | |
| "plugins": ["@trivago/prettier-plugin-sort-imports"] | |
| } |
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
| alias subl='open -a "Sublime Text"' | |
| alias l="ls -la" |
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
| /** | |
| * Enum which supports attached methods. | |
| * Each method's `this` is the enum object. | |
| */ | |
| class Enum { | |
| /** | |
| * @param items {Object} Enum keys and values as a plain object | |
| * @param methods {Object} Enum methods as a plain object | |
| * (names are keys, values are methods) | |
| */ |
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
| ################################################################################ | |
| # | |
| # 1. Save this file to /usr/local/bin | |
| # | |
| # 2. To make it executable: chmod u+x /usr/local/bin/create-react-app-minimal.sh | |
| # | |
| # 3. To create your app: create-react-app-minimal {app-name} | |
| # | |
| # 4. In your package.json, change this line: | |
| # "test": ... |
NewerOlder