Skip to content

Instantly share code, notes, and snippets.

View qodunpob's full-sized avatar
🥃
Drink Driven Development

Konstantin qodunpob

🥃
Drink Driven Development
View GitHub Profile

Тестовое задание для соискателя на вакансию full-stack разработчика.

Задание

Необходимо разработать приложение для учета заказов в кафе со следующим функционалом.

Страницы:

  • список столов;
  • страница отдельного стола.
@qodunpob
qodunpob / typed-merge.ts
Created March 25, 2020 12:30
TypeScript tricks
type OptionalOf<T> = { [K in keyof T]?: T[K] }
function typedMerge<T extends object>(target: T, ...sources: OptionalOf<T>[]): T {
return Object.assign(target, ...sources)
}
interface IUser {
name: string;
age: number;
hobbie: HOBBIES;
@qodunpob
qodunpob / monokaipro.reg
Created February 27, 2019 09:45
Monokai Pro color theme for Windows command prompt. Based on https://www.monokai.pro/
Windows Registry Editor Version 5.00
; Monokai Pro color theme for Windows command prompt.
; Based on https://www.monokai.pro/
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK
"ColorTable00"=dword:002d292c
; BLUE
"ColorTable01"=dword:00e8dc78
const build = spawnSync('npm', ['run', 'build'], getSpawnOptions(rootDir));
spawnSync('rm', ['-rf', 'temp'], getSpawnOptions(rootDir));
/* message of the last commit in source code repository */
const lastCommitMessage = spawnSync(
'git',
['log', '--oneline', '-1'],
getSpawnOptions(rootDir, 'pipe')
).stdout.toString().trim();
/* commit message in build repository */
const message = buildBranch === 'master' ? version : lastCommitMessage;
/* making commit in builds repository */
/* creating build files copies */
spawnSync('cp', ['-r', 'lib', 'temp/lib'], getSpawnOptions(rootDir));
spawnSync('cp', ['package.json', 'temp/package.json'], getSpawnOptions(rootDir));
spawnSync('cp', ['package-lock.json', 'temp/package-lock.json'], getSpawnOptions(rootDir));
spawnSync('cp', ['README.md', 'temp/README.md'], getSpawnOptions(rootDir));
/* indexing the build files */
spawnSync('git', ['add', '--all'], getSpawnOptions(tempDir));
/* removing the old build files */
spawnSync(
'rm',
['-rf', 'lib', 'package.json', 'package-lock.json', 'README.md'],
getSpawnOptions(tempDir)
);
/* checking if branch exists in builds repository */
const isBranchExits = !!spawnSync(
'git',
['ls-remote', '--exit-code', 'origin', buildBranch],
getSpawnOptions(tempDir, 'pipe')
).stdout.toString().trim();
if (isBranchExits) {
/* checkout the target branch */
spawnSync('git', ['fetch', 'origin', buildBranch], getSpawnOptions(tempDir));