Skip to content

Instantly share code, notes, and snippets.

View ShashkovS's full-sized avatar

Sergey Shashkov ShashkovS

  • Uchi.ru
  • Moscow, Russia
View GitHub Profile
import asyncio
from time import process_time as time
async def anoop() -> None:
pass
def noop() -> None:
pass
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Sergey Shashkov",
"label": "Software Engineer, Educator, and Product Manager",
"image": "shashkovs.jpg",
"email": "[email protected]",
"phone": "+77057247666",
"url": "",
"summary": "Experienced developer, product manager, and math and programming teacher with a background spanning 18 years in education and 12 years in programming.",
@ShashkovS
ShashkovS / enum_plus_sqlite.py
Created October 17, 2022 18:17
Пример хранения ENUM'ов в базе
from enum import Enum, IntEnum, unique, EnumMeta
from operator import attrgetter
from time import perf_counter_ns
from random import randrange
import sqlite3
# Сколько раз дублируем все записи
INSERTS = 100000
FETCHES = 100000
import itertools
import numpy as np
from numpy.linalg import inv
from time import time
from sympy.matrices import Matrix
import sympy
N = 6
# Все ненулевые строки
zero_one_rows = [np.matrix(row, dtype=np.float64) for row in itertools.product([0, 1], repeat=N) if any(row)]
@ShashkovS
ShashkovS / гоночки.py
Created April 1, 2022 08:03
Гоночки на троих
from drawzero import *
cars_y = [540, 500, 460]
cars_x = [100, 100, 100]
ups = [K.w, K.i, K.UP]
downs = [K.s, K.k, K.DOWN]
lefts = [K.a, K.j, K.LEFT]
rights = [K.d, K.l, K.RIGHT]
colors = ['green', 'blue', 'yellow']
scores = [1000, 1000, 1000]
@ShashkovS
ShashkovS / firework.py
Created March 11, 2022 07:57
Бенгальский огонь!
from drawzero import *
import random
import math
from dataclasses import dataclass
START = START_X, START_Y = (500, 200)
G = -2.0
START_SPEED = 20
STICK_WIDTH = 5
TOP = 600
import pygame
from pygame import locals
import sys
from random import randint, choice, uniform
from dataclasses import dataclass
NUM_STARS = 300
D = 1
from drawzero import *
from random import randint, choice, uniform
from dataclasses import dataclass
NUM_STARS = 100
D = 1
Vx, Vy, Vz = (500, -3, 100)
# Список скоростей, которые мы будем каждые 2 секунды менять
speed_list = [
(500, 0, 0),
@ShashkovS
ShashkovS / installOpenVpn.sh
Created September 12, 2021 07:26
Install and config OpenVNP on CentOs
# openvpn
# Нужно знать IP своего вебсервера. Пусть это будет 123.123.123.123 (replace наше всё)
# И выбрать порт, на котором оно будет работать. Если vps пустой, то лучше всего порт 443 (это https).
# Если там уже есть вебсервер, то replace наше всё, мы будем использовать порт 12312
# Разное стартовое, если сервер совсем «голый»
# yum -> dnf
yum upgrade
@ShashkovS
ShashkovS / pygame ball.py
Created February 3, 2021 12:29
Сталкивающиеся шарики разных масс и радиусов на pygame
from random import randint, uniform
from math import hypot
import pygame
import sys
SCREEN_SIZE = WIDTH, HEIGHT = (1000, 1000)
# Готовим 200 кругов в случайных местах случайного радиуса и цвета
N = 200
CIRCLES = [