This is a simple background script to kill git-credential-manager when it hits the 100% cpu bug
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 { UnionToIntersection } from 'type-fest'; | |
export type ExclusifyUnion<T> = ExclusifyUnion_<T, T>; | |
type ExclusifyUnion_<T, U> = T extends never | |
? never | |
: T & EmptyDifference<T, Exclude<U, T>>; // eslint-disable-line @typescript-eslint/sort-type-constituents | |
type EmptyDifference<T, U> = Omit< | |
UnionToIntersection<T extends never ? never : { [K in keyof U]?: never }>, | |
keyof T | |
>; |
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
interface AsyncCompose { | |
<Options, R1, R2, R3>( | |
f: (options: Options) => R1, | |
g: (arg: Awaited<R1>, options: Options) => R2, | |
h: (arg: Awaited<R2>, options: Options) => R3, | |
): (options: Options) => R2; | |
<R1, R2>(f: () => R1, g: (arg: Awaited<R1>) => R2): () => R2; | |
<Options, R1, R2>( | |
f: (options: Options) => R1, | |
g: (arg: Awaited<R1>, options: Options) => R2, |
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
async function main() { | |
console.log('main'); | |
} | |
(async function () { | |
if ('undefined' !== typeof module) { | |
return require.main === module && main(); | |
} | |
// eslint-disable-next-line no-new-func | |
const meta: ImportMeta = new Function('import.meta')(); |
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 unit = <T>(value: T) => () => value; | |
const lazy = <T>(fn: () => T) => { | |
let f = (): T => (f = unit(fn()))(); | |
return () => f(); | |
}; | |
const lazyWithReset = <T>(fn: () => T) => { | |
let f: () => T; | |
const reset = () => { | |
f = () => (f = unit(fn()))(); |
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
// limit to 9 entries in the union, otherwise type instantiation gets very deep | |
export type ConstArrayOf<T, T2 = T> = [T] extends [never] | |
? [] | |
: T extends infer U | |
? [U, ...ConstArrayOf<Exclude<T2, U>>] | |
: never; |
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 type Overrides<T extends (...args: any) => any> = T extends { | |
(...args: infer A0): infer R0; | |
(...args: infer A1): infer R1; | |
(...args: infer A2): infer R2; | |
(...args: infer A3): infer R3; | |
(...args: infer A4): infer R4; | |
(...args: infer A5): infer R5; | |
(...args: infer A6): infer R6; | |
(...args: infer A7): infer R7; | |
(...args: infer A8): infer R8; |
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 { | |
Collection, | |
Database, | |
ReplicaSet, | |
Shard, | |
ShellInstanceState, | |
} from '@mongosh/shell-api'; | |
import { ShellApiClass } from '@mongosh/shell-api/lib/decorators'; | |
type ShellApi = ShellInstanceState['shellApi']; |
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
Show hidden characters
{ | |
"editor.semanticTokenColorCustomizations": { | |
"rules": { | |
"*.mutable": { | |
"fontStyle": "bold" | |
}, | |
"*.typeHint": { | |
"fontStyle": "italic" | |
}, | |
"interface": { |
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
{ | |
"customizeUI.font.monospace": "FantasqueSansMono Nerd Font", | |
"customizeUI.font.regular": "SF Pro Display", | |
"customizeUI.fontSizeMap": { | |
"13px": "12px" | |
}, | |
"customizeUI.stylesheet": { | |
".mac, .windows, .linux": "letter-spacing: -0.02rem", | |
".mac.trongthanh-theme-boxythemekit-themes-Boxy-Yesterday-json": "-webkit-text-stroke: 0.3px", | |
".minimap": "opacity: 0.5", |
NewerOlder