Skip to content

Instantly share code, notes, and snippets.

View rodion-solovev-7's full-sized avatar

Родион Соловьев rodion-solovev-7

  • bank24
  • Ekaterinburg
View GitHub Profile
@rodion-solovev-7
rodion-solovev-7 / netflix_titles.csv
Created October 20, 2021 13:08
Netflix titles (movies) in csv
We can't make this file beautiful and searchable because it's too large.
show_id,type,title,director,cast,country,date_added,release_year,rating,duration,listed_in,description
81145628,Movie,Norm of the North: King Sized Adventure,"Richard Finn, Tim Maltby","Alan Marriott, Andrew Toth, Brian Dobson, Cole Howard, Jennifer Cameron, Jonathan Holmes, Lee Tockar, Lisa Durupt, Maya Kay, Michael Dobson","United States, India, South Korea, China","September 9, 2019",2019,TV-PG,90 min,"Children & Family Movies, Comedies","Before planning an awesome wedding for his grandfather, a polar bear king must take back a stolen artifact from an evil archaeologist first."
80117401,Movie,Jandino: Whatever it Takes,,Jandino Asporaat,United Kingdom,"September 9, 2016",2016,TV-MA,94 min,Stand-Up Comedy,"Jandino Asporaat riffs on the challenges of raising kids and serenades the audience with a rousing rendition of ""Sex on Fire"" in his comedy show."
70234439,TV Show,Transformers Prime,,"Peter Cullen, Sumalee Montano, Frank Welker, Jeffrey Combs, Kevin Michael Richardson, Tania Gunadi, Josh Keaton, Steve
@rodion-solovev-7
rodion-solovev-7 / 2021.10.22_log_comparing.ipynb
Last active October 23, 2021 08:56
Сами файлы логов не залились [:-|]. С учётом поправок, записей, отсутствующих в pin_log.txt, но присутствующих в pintset_finish.log - нет. out2.txt - записи из pintset_finish.log, которых нет в pin_log.txt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rodion-solovev-7
rodion-solovev-7 / decorator_with_keep_signature.py
Last active February 2, 2022 17:22
Декоратор, подменяющий код, но сохраняющий сигнатуру функции
import functools
import inspect
from typing import TypeVar, Callable
RetT = TypeVar("RetT")
def replace_code_and_keep_signature(func: Callable[..., RetT]) -> Callable[..., RetT]:
"""Декоратор, который создаёт функцию с эквивалентной сигнатурой, но другим кодом.
@rodion-solovev-7
rodion-solovev-7 / GenericDAL_example.ipynb
Created February 10, 2022 09:41
(Не)адекватное использование Generic в python-коде: получение T-класса и пример нафига это может понадобиться
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rodion-solovev-7
rodion-solovev-7 / drinkin_game.py
Created February 15, 2022 12:48
Drinkin' game (Lena's Adventures)
# Дата: где-то около октября 2020
#
# Написано за час на паре как доказательство того, что классы существуют.
# (Да-да, они и вправду существуют!)
# Правок и изменений архитектуры не планируется.
from random import randint
class Alcohol:
@rodion-solovev-7
rodion-solovev-7 / queries.sql
Last active March 31, 2022 14:46
Generate SQL for DB creation (SQLAlchemy)
CREATE TABLE my_table (
id SERIAL NOT NULL,
my_data VARCHAR,
PRIMARY KEY (id)
);
@rodion-solovev-7
rodion-solovev-7 / move_window_to_workspace_and_switch_it.sh
Created May 22, 2022 09:50
Sends the window to the right workspace + switches to this workspace. Useful as a shortcut script if your Linux does not support this shortcut
win_id="$(xdotool getactivewindow)";
desk_id="$(xdotool get_desktop)";
desk_id=$((desk_id + 1));
xdotool set_desktop_for_window "$win_id" "$desk_id";
xdotool set_desktop "$desk_id";
@rodion-solovev-7
rodion-solovev-7 / prepare_spelling_dict.sh
Created June 21, 2022 21:58
Spelling dictionaris for IDE (ru).sh
mkdir -p ~/.ide-spelling/
curl https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/Russian.aff >> .ide-spelling/Russian.aff
curl https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/Russian.dic >> .ide-spelling/Russian.dic
# TODO: add directly into PyCharm config
@rodion-solovev-7
rodion-solovev-7 / example.py
Created January 3, 2023 16:08
Упоротый способ внедрять fastapi.Depends туда, где он не нужен
from fastapi import Depends
from fastapi_depends import inject_dependencies
def get_my_dep1() -> str:
# any type obj may be here. sqlalchemy.session and etc
yield 'HELLO WORLD'
@inject_dependencies()
@rodion-solovev-7
rodion-solovev-7 / cache_result_by_args.py
Created September 22, 2023 22:38
Try to write own async-sync ttl cache decorator (danger: shitcode)
import asyncio
import functools
import time
def cached_by_args(sync_or_async_func):
expiration_offset = 1.5
cache = {}
def is_cache_actual(args, kwargs, now) -> bool: