class Person {
name = 'Ilya Maslennikov';
nickname = 'xrip';
title = 'Software Engineer / Tech Lead';
location = 'Moscow, Russia';
}
class Skills {
languages = ['TypeScript', 'JavaScript', 'PHP'];
This file contains 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
import { randomInt } from "node:crypto" | |
import type Puppeteer from "puppeteer-core" | |
/** Recast Puppeteer private properties **/ | |
type Page = Omit<Puppeteer.Page, "_client"> & { | |
readonly _client: Puppeteer.CDPSession | |
} | |
type ElementHandle = Omit<Puppeteer.ElementHandle, "_page"> & { |
This file contains 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
#!/usr/bin/env python | |
import sys | |
import msvcrt | |
import os | |
import ctypes | |
import shutil | |
PIPE_ACCESS_INBOUND = 0x00000001 | |
PIPE_ACCESS_OUTBOUND = 0x00000002 | |
PIPE_TYPE_BYTE = 0x00000000 |
This file contains 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
#!/bin/sh | |
# Written by: Keefer Rourke <https://krourke.org> | |
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git> | |
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git | |
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git | |
srcdir="/tmp/google-fonts" | |
pkgdir="/usr/share/fonts/truetype/google-fonts" | |
giturl="git://github.com/google/fonts.git" |
This file contains 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
import { RequestOptions, get as httpsGet, request as httpsRequest } from 'https'; | |
import { IncomingMessage } from 'http'; | |
const makeCallback = (resolve: (data: string | unknown) => void, reject: (e: Error) => void, json = false) => (response: IncomingMessage): void => { | |
let buffer = ''; | |
response.on('data', chunk => buffer += chunk); | |
response.on('end', () => { | |
try { |
This file contains 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
/* parameter helpers */ | |
// https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_filter_anisotropic | |
const getMaxAnisotropy = context => { | |
try { | |
const extension = ( | |
context.getExtension('EXT_texture_filter_anisotropic') || | |
context.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || | |
context.getExtension('MOZ_EXT_texture_filter_anisotropic') | |
) | |
return context.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) |
This file contains 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
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 3000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Mobile Intel(R) 4 Seri |
This file contains 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
() => { | |
function hookPrototypeMethods(prefix, object) { | |
// TODO: also hook getters | |
if (!object) return; | |
const originals = {}; | |
const prototype = Object.getPrototypeOf(object); | |
Object | |
.getOwnPropertyNames(prototype) | |
.filter((n) => { | |
try { |
This file contains 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
import { IncomingMessage, RequestListener, ServerResponse } from "http" | |
import { createServer, Server } from "https" | |
import puppeteer, { | |
Browser, | |
BrowserLaunchArgumentOptions, | |
Protocol | |
} from "puppeteer-core" | |
import { Page } from "./types" | |
import Cookie = Protocol.Network.Cookie |
This file contains 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
#!/bin/bash | |
# Replace <CLICKHOUSE.IP>, <CLICKHOUSE_USERNAME> AND <CLICKHOUSE_PASSWORD> with your clickhouse credentials | |
# and <SHORT_TABLE_NAME> together with <FULL_TABLE_NAME> | |
clickhouse-client --host <CLICKHOUSE.IP> --user <CLICKHOUSE_USERNAME> --password '<CLICKHOUSE_PASSWORD>' -q "SELECT DISTINCT partition FROM system.parts WHERE table='<SHORT_TABLE_NAME>' and max_date<today()-INTERVAL 3 MONTH;" | cut -d "'" -f2 | tr -d '\' | while read line; do clickhouse-client --host <CLICKHOUSE.IP> --user <CLICKHOUSE_USERNAME> --password '<CLICKHOUSE_PASSWORD>' -q "ALTER TABLE <FULL_TABLE_NAME> DROP PARTITION "$line"";done |