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 PickFnArgs<Q> = Q extends (...args: infer P) => unknown ? P : 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
/* | |
PUT THIS FILE IN ~/Library/KeyBindings/DefaultKeyBinding.dict | |
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely | |
match default behavior on Windows systems. This particular mapping assumes | |
that you have also switched the Control and Command keys already. | |
This key mapping is more appropriate after switching Ctrl for Command in this menu: | |
Apple->System Preferences->Keyboard & Mouse->Keyboard->Modifier Keys...-> | |
Change Control Key to Command | |
Change Command key to Control |
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 Unpromise<T extends Promise<any>> = T extends Promise<infer U> ? 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
import { useState, useCallback } from 'react'; | |
import { PickOne } from 'pick-one.type'; | |
export type UseStateEnhancedManagement<T> = [ | |
T, | |
{ | |
setState: React.Dispatch<React.SetStateAction<T>>; | |
setProperty: (property: PickOne<T>) => void; | |
setProperties: (properties: Partial<T>) => void; | |
} |
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 PickOne<T> = { [P in keyof T]: Record<P, T[P]> & Partial<Record<Exclude<keyof T, P>, undefined>> }[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
import { FindOperator, LessThan, MoreThan } from "typeorm" | |
import moment, { Moment, MomentInput } from 'moment'; | |
export const MoreThanDate = (date:MomentInput) => MoreThan( | |
new FindOperator( | |
'moreThan', | |
moment(date).format( 'YYYY-MM-DD HH:mm:ss' ), | |
) | |
); |