Skip to content

Instantly share code, notes, and snippets.

View VladSez's full-sized avatar

Vlad Sazonau VladSez

View GitHub Profile
import { Credential, Prisma } from "@prisma/client";
import { GetTokenResponse } from "google-auth-library/build/src/auth/oauth2client";
import { Auth, calendar_v3, google } from "googleapis";
import { getLocation, getRichDescription } from "@calcom/lib/CalEventParser";
import CalendarService from "@calcom/lib/CalendarService";
import { HttpError } from "@calcom/lib/http-error";
import logger from "@calcom/lib/logger";
import prisma from "@calcom/prisma";
import type {
@VladSez
VladSez / contribute.md
Last active May 21, 2022 19:03
Open source repos to contribute
const config = {
use: {
channel: "chrome",
deviceScaleFactor: 2,
launchOptions: {
// force GPU hardware acceleration (even in headless mode)
// without hardware acceleration, our tests will be much slower
args: ["--use-gl=egl"]
}
}
@VladSez
VladSez / data-structures.js
Created July 6, 2022 11:20
Data structures
'use strict';
/**
* ███████████████═╗ ███████████████═╗ █████████████═╗ █████═╗ █████═╗
* ███████████████ ║ ███████████████ ║ ███████████████ ║ █████ ║ █████ ║
* ╚═══█████ ╔════╝ ╚═══█████ ╔════╝ █████ ╔═════════╝ █████ ║ █████ ║
* █████ ║ █████ ║ █████ ║ █████ ║ █████ ║
* █████ ║ █████ ║ █████████████═╗ ███████████████ ║
* █████ ║ █████ ║ ╚█████████████═╗ ╚███████████ ╔═╝
* █████ ║ █████ ║ ╚══════█████ ║ ╚═█████ ╔══╝
@VladSez
VladSez / compiler.js
Created July 6, 2022 11:22
Super tiny compiler
'use strict';
/**
* TTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHH HHHHHHHHHEEEEEEEEEEEEEEEEEEEEEE
* T:::::::::::::::::::::TH:::::::H H:::::::HE::::::::::::::::::::E
* T:::::::::::::::::::::TH:::::::H H:::::::HE::::::::::::::::::::E
* T:::::TT:::::::TT:::::THH::::::H H::::::HHEE::::::EEEEEEEEE::::E
* TTTTTT T:::::T TTTTTT H:::::H H:::::H E:::::E EEEEEE
* T:::::T H:::::H H:::::H E:::::E
* T:::::T H::::::HHHHH::::::H E::::::EEEEEEEEEE
@VladSez
VladSez / little-virtual-computer.js
Last active July 7, 2022 15:35
Learn how computers work by simulating them in Javascript. Original: https://github.com/jsdf/little-virtual-computer
// @flow
/*
Components: (do a ctrl-f find for them)
1.MEMORY
2.CPU
3.DISPLAY
4.INPUT
5.AUDIO
@VladSez
VladSez / permissions.ts
Created July 10, 2022 16:22
Basic permissions with TS
const userRoles = {
admin: ["create", "update", "delete", "view"],
user: ["update", "view"],
anonymous: ["view"],
} as const;
type UserRoles = typeof userRoles;
const canRolePerformAction = <TRole extends keyof UserRoles>(
role: TRole,
@VladSez
VladSez / ts-snippets.ts
Last active September 15, 2022 11:05
Some TS snippets
// challenges: https://github.com/type-challenges/type-challenges
// more challenges https://github.com/LearningTypeScript/projects/tree/main/projects/type-operations/array-type-shenanigans
// ts-play url shortener
// https://tsplay-dev.vercel.app/
// https://tsplay.dev/wepV1W
// https://github.com/type-challenges/type-challenges/blob/main/questions/00949-medium-anyof/README.md
// https://tsplay.dev/NDyplm