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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
| async sleep(ms): Promise<void> { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, ms); | |
| }); | |
| } |
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
| static scan(data, label) { | |
| let result | |
| if (Array.isArray(data)) { | |
| for (const item of data) iteration(item, label) | |
| } else iteration(data, label) | |
| function iteration(data, label) { | |
| for (const elements in data) { | |
| if (elements === label) { | |
| if (data[elements]) result = data[elements] |
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
| /** | |
| * Генерация хеша | |
| * @param {string} string - Строка из которой генерируется хэш | |
| * @return Возвращает сгенерированный хэш | |
| */ | |
| hashCode(string: string): string { | |
| const hash = createHash('sha256') | |
| hash.update(string) | |
| return hash.copy().digest('hex') | |
| } |