Skip to content

Instantly share code, notes, and snippets.

View borislavstoychev's full-sized avatar
💭
💻 Coding....

Borislav Stoychev borislavstoychev

💭
💻 Coding....
View GitHub Profile
function catalogues(arr) {
let catalogue = new Map();
arr.forEach(element => {
[keys, values] = element.split(" : ");
catalogue.set(keys, values)
});
let sorted = Array.from(catalogue.entries())
.sort(([keyA, valueA], [keyB, valueB]) => keyA.localeCompare(keyB));
let result = {};
sorted.forEach(element => {
Part Type Pieces Part Name Part price, lv Part Link
HDD 6 SEAGATE Exos X16 512E/4KN 16TB ST16000NM001G чакам доставка Link
M.2 SSD for plotting 1 Samsung 980 PRO чакам доставка Link
M.2 SSD for OS 1 Samsung 970 EVO Plus 135 Link
Motherboard 1 MSI MAG B550 TOMAHAWK 352 Link
CPU 1 AMD RYZEN 7 3700X 8-Core 3.6 GHz 596 [Link](https://pcmall.bg/%d0%bf%d1%80%d0%be%d1%86%d0%b5%d1%81%d0%be%d1%80-amd-ryzen-7-3700x-8-core-3.6-ghz-4.4-ghz-turbo-36mb-65w-am4-box-amd-am4-r7-ryzen-3
function partyTime(arr) {
let map = new Map();
let [guestList, party] = arr.split("PARTY")
while (arr.length) {
let element = arr.shift();
if (!map.has(element)) {
if (element === "PARTY") {
break;
}
function arenaTier(arr) {
let arena = {};
function sortByName(a, b) {
return a.localeCompare(b);
}
function sortBySum(objA, objB) {
let sumB = Object.entries(objB).reduce((a,v) => a += v[1], 0);
let sumA = Object.entries(objA).reduce((a,v) => a += v[1], 0);
function game(arr){
let first = 'X';
let second = 'O';
const matrix = [
[false, false, false],
[false, false, false],
[false, false, false]
];
const diagonals = (matrix) => matrix.reduce((a, v, i) => a + v[i], '');
const col = (matrix, i) => matrix[i].reduce((a, b, j) => a + matrix[j][i], '');
function solve(input) {
let list = [];
const listCreator = (cmd, el) => {
let result = {
add: () => list.push(el),
remove: () => list = list.filter((x) => x !== el),
print: () => console.log(list.join(',')),
}
result[cmd]()
function calculator() {
let num1;
let num2;
let result;
return {
init: (selectorNum1, selectorNum2, selectorResult) =>{
num1 = document.getElementById(selectorNum1);
num2 = document.getElementById(selectorNum2);
result = document.getElementById(selectorResult);
},
import { ApiProperty } from '@nestjs/swagger'
import { Expose } from 'class-transformer'
import { IsDateString, IsEmail, IsNotEmpty, IsString } from 'class-validator'
@Expose()
export class CreateBootcampDto {
@ApiProperty()
@Expose()
@IsString()
@IsNotEmpty()
status: string
import { PartialType } from '@nestjs/swagger';
import { CreateBootcampDto } from './create-bootcamp.dto';
export class UpdateBootcampDto extends PartialType(CreateBootcampDto) {}
import { Test, TestingModule } from '@nestjs/testing'
import { CampaignDocumentRole, PrismaPromise } from '@prisma/client'
import { prismaMock } from '../prisma/prisma-client.mock'
import { PrismaService } from '../prisma/prisma.service'
import { CampaignDocumentRoleService } from './campaign-document-role.service'
const mockData = [
{
id: '5f9221cf-f067-4011-8d2a-66b59509fb7b',
createdAt: new Date('2000-10-31T01:30:00.000-05:00'),