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 CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` | |
? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` | |
: Lowercase<S> | |
type KeysToCamelCase<T> = { | |
[K in keyof T as CamelCase<string & K>]: T[K] | |
} | |
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? |
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
[user] | |
name = Luca Del Puppo | |
email = email | |
[core] | |
editor = code-insiders --wait | |
autocrlf = input | |
[init] | |
defaultBranch = main | |
[filter "lfs"] | |
required = true |
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
git config --global user.name "Luca Del Puppo" | |
git config --global user.email | |
git config --global core.editor "code-insiders --wait" | |
git config --global core.autocrlf input | |
git config --global pull.rebase true |
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
git checkout <old_name> | |
git branch -m <new_name> | |
git push origin -u <new_name> | |
git push origin --delete <old_name> |
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/bash | |
git remote prune origin | |
git branch -a -v | grep -e '\[gone\]' | awk {'print $1'} | xargs git branch -D |
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 interface NonEmptyArray<A> extends ReadonlyArray<A> { | |
// tslint:disable-next-line: readonly-keyword | |
0: A; | |
} | |
type ReadOnlyNotEmptyArray<T> = Readonly<NotEmptyArray<T>>; | |
function isNotEmptyArray<T>(as: T[]): as is NotEmptyArray<T> { | |
return as.length > 0; | |
} |
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 KeyOf<E> = keyof E; | |
/** | |
* Convert const enum to types | |
* @example | |
* const ENUM_CONST = { | |
* KEY1: "VALUE1", | |
* KEY2: "VALUE2", | |
* KEY3: 3, | |
* KEY4: true, | |
* } as const; |