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
| export default function<T extends (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>>(fnAsync: T, { trailing }: { trailing?: boolean } = { trailing: false }) { | |
| let promise: Promise<Awaited<ReturnType<T>>> | undefined | |
| let calledAgain = false | |
| let lastArgs: Parameters<T> | undefined | |
| const deduped = async function (...args: Parameters<T>) { | |
| if (promise) { | |
| calledAgain = true | |
| lastArgs = args |
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
| # Bash | |
| alias c="clear" | |
| alias d="exit" | |
| alias beep='powershell "[console]::beep(500,300)"' | |
| # Git | |
| alias gl="git log" | |
| alias gg="git log --oneline --graph --all" | |
| alias gs="git status" | |
| alias gb="git branch --sort=-committerdate" |
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
| curl -fsSL https://get.docker.com | sh |
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
| /** | |
| * @returns {number} Возвращает количество пикселей ширины полосы прокрутки браузера. | |
| */ | |
| static getScrollWidth() | |
| { | |
| let div = document.createElement('div'); | |
| div.style.display = 'inline-block'; | |
| div.style.visability = 'hidden'; | |
| div.style.width = '50px'; | |
| div.style.height = '50px'; |