Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Freestyler

Konstantin qodunpob

🎧
Freestyler
View GitHub Profile
View cartbee-test-task.md

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

Задание

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

Страницы:

  • список столов;
  • страница отдельного стола.
View Xiaomi Mi Notebook Pro ❤ Linux.md
@qodunpob
qodunpob / typed-merge.ts
Created Mar 25, 2020
TypeScript tricks
View typed-merge.ts
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 Feb 27, 2019
Monokai Pro color theme for Windows command prompt. Based on https://www.monokai.pro/
View monokaipro.reg
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
View publish__fragment_2.ts
const build = spawnSync('npm', ['run', 'build'], getSpawnOptions(rootDir));
View publish__fragment_9.ts
spawnSync('rm', ['-rf', 'temp'], getSpawnOptions(rootDir));
View publish__fragment_8.ts
/* 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 */
View publish__fragment_7_2.ts
/* 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));
View publish__fragment_7_1.ts
/* removing the old build files */
spawnSync(
'rm',
['-rf', 'lib', 'package.json', 'package-lock.json', 'README.md'],
getSpawnOptions(tempDir)
);
View publish__fragment_6.ts
/* 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));