Team Disco
- Dylan Roberts
- James Viall
Typing the useState React hook
| # what is my active AWS Profile? | |
| alias awswho='aws sts get-caller-identity' | |
| # Start a fresh session with my active AWS Profile | |
| alias awslogin='aws sso login' | |
| # Switch my active AWS Profile: e.g. `awsp res-dev` | |
| function awsp() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: awsp <profile-name>" | |
| echo "Available profiles:" | |
| aws configure list-profiles |
| ## First let's download YADM using Homebrew | |
| brew install yadm | |
| ## did it work? You can check out the docs at https://yadm.io | |
| which yadm | |
| ## YADM, as well as many other dotfile managament tools, uses the same commands as Git such as checkout, add, and commit | |
| ## We can use `yadm clone` to get a dotfiles repo going. So let's create a new repo called "dotfiles" and then clone it | |
| open https://github.com/new?name=dotfiles | |
| yadm clone jviall/dotfiles |
| export function useAsyncDebounce<T extends (args: any[]) => any>(defaultFn: T, defaultWait: number): T { | |
| const debounceRef = React.useRef<{ | |
| promise?: Promise<T>, | |
| resolve?: (value: T | PromiseLike<T>) => void, | |
| reject?: (reason?: any) => void, | |
| timeout?: NodeJS.Timeout | |
| }>({}) | |
| // the given args could be props, which change, so we want to always use latest definitions. | |
| const getDefaultFn = useGetLatest(defaultFn) |