Skip to content

Instantly share code, notes, and snippets.

View Kiruha01's full-sized avatar

Kirill Lisov Kiruha01

  • Saint-Petersburg
View GitHub Profile
@Kiruha01
Kiruha01 / pyscreamer.py
Created October 25, 2020 12:18
Python screamer
import subprocess, time, winsound
"""
ONLY FOR WINDOWS!
Fall asleep for 3 seconds
Increase system volume to MAX via nicrmd - https://www.nirsoft.net/utils/nircmd.html
Play your screamer 1.wav
"""
time.sleep(3)
JSON: struct = [{"term": 1, "subjects": [
{"name": "...",
"lecturers": [
{"name": ..., id: ...} ...
]
]
...
}]
// main component:
@Kiruha01
Kiruha01 / install.sh
Last active December 8, 2020 22:42
bash for OS lecturers
#!/bin/bash
if [[ ! -e $HOME/bin/ ]]
then
mkdir $HOME/bin/
fi
cp sf $HOME/bin/
echo 'export PATH=$PATH:$HOME/bin/' >> $HOME/.bashrc
source $HOME/.bashrc
https://gist.github.com/f11b32d31b99aae01e266f97a7101227
@Kiruha01
Kiruha01 / P.py
Last active April 5, 2021 17:24
SALE
class Permutation(object):
"""
Класс, описывающий перестановку строк в матрице
P - массив перестановки
even - чётность перстановки
1 - чётна
-1 - нечётна
"""
def __init__(self, n):
def weak_conns(graph: BaseGraph) -> List[List[int]]:
"""Поиск компонент слабой связности"""
unvisited = copy.deepcopy(graph.get_all_vertices())
comps = []
while unvisited:
start = unvisited.pop()
comps.append([])
stack = deque([start])
@Kiruha01
Kiruha01 / Davidon-Flatcher-Pauel.py
Created June 1, 2022 14:02
Метод Дэвидона-Флетчера-Пауэлла
import math
h = 0.01
x1 = - 2
eps = 1e-3
#f = x * x + 4 * x * math.sin(x) + math.cos(x)
# выбор x1 и x2 для оптимального _x
def opt(w, a, b, c, h) :
@Kiruha01
Kiruha01 / img.png
Last active June 10, 2022 12:09
Polynomial Interpolation Via Point Trajectories
img.png
@Kiruha01
Kiruha01 / README.md
Last active January 21, 2023 07:18
Promocodes

Promocodes

Установка зависимостей

Открой в терминале эту папку и введи

pip install -r requirements.txt

Инструкция

Открой файл config.yml и введи данные:

@Kiruha01
Kiruha01 / main.py
Created June 29, 2023 08:37
PRC openapi
def get_application(
add_internal_error_handler: bool = True,
callback_repo: Optional[CallbackRepoProto] = None,
) -> FastAPI:
"""Create configured server application instance."""
application = FastAPI(title=BOT_PROJECT_NAME)
def get_custom_openapi():
return custom_openapi(
title="a",