Skip to content

Instantly share code, notes, and snippets.

View KonstantinKlepikov's full-sized avatar
☮️
War, yeah, what is it good for? Absolutely nothing!

Konstantin Kl. KonstantinKlepikov

☮️
War, yeah, what is it good for? Absolutely nothing!
View GitHub Profile
@KonstantinKlepikov
KonstantinKlepikov / .dockerignore
Created January 25, 2024 11:35
clean git and docker (python)
**/__pycache__
**/.pytest_cache
**/.scrapy
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
@KonstantinKlepikov
KonstantinKlepikov / docker-compose.yaml
Created January 15, 2024 20:31 — forked from nobbynobbs/docker-compose.yaml
kafka and kafka-ui, without zookeeper
version: '2.4'
services:
kafka:
image: bitnami/kafka:3.1.0
container_name: kafka
command:
- 'sh'
- '-c'
- '/opt/bitnami/scripts/kafka/setup.sh && kafka-storage.sh format --config "$${KAFKA_CONF_FILE}" --cluster-id "lkorDA4qT6W1K_dk0LHvtg" --ignore-formatted && /opt/bitnami/scripts/kafka/run.sh' # Kraft specific initialise
environment:
@KonstantinKlepikov
KonstantinKlepikov / task.md
Created December 19, 2023 15:19 — forked from CaerDarrow/task.md
Task

Реализовать сервис для обработки файлов. С сервисом может работать одновременно несколько пользователей.
В сервисе обязательно должен быть endpoint /file c, как минимум, двумя обработчиками:

  • GET /file отдает веб-страницу с формой, через которую мы можем отправить файл на обработку.
  • POST /file - обработчик, который принимает файл из формы

Обработка:

  • файл может быть только с MIME type - text/csv
  • файл может быть любого размера
@KonstantinKlepikov
KonstantinKlepikov / .gitignore
Created September 8, 2023 12:21
gitignore template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
def inhouse_factorial(x: int) -> int:
"""Напишите, пожалуйста рекурсивное
вычисление факториала, работающего для всех int
"""
if x < 0:
raise ValueError
elif x == 0 or x == 1:
return 1
else:
return x * inhouse_factorial(x - 1)
from typing import Any
Item = dict[str, Any]
Items = list[Item]
ItemsById = dict[int, Item]
ItemsCollection = dict[int, list[Item]]
class TreeStore:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KonstantinKlepikov
KonstantinKlepikov / PixelPerfectScaling.gd
Created March 11, 2023 18:33 — forked from atomius0/PixelPerfectScaling.gd
Pixel-Perfect scaling script, ported to Godot 3.
# original code by CowThing: https://github.com/godotengine/godot/issues/6506
# port to Godot 3 and bugfixes by atomius.
# usage:
# set this script as AutoLoad (Singleton enabled)
#
# in the project settings:
# [display]
# set 'window/size/width' and 'window/size/height' to your desired render resolution.
# set 'window/size/test_width' and 'window/size/test_height' to the initial window size.
class Mapping(dict):
def __setitem__(self, key, item):
self.__dict__[key] = item
def __getitem__(self, key):
return self.__dict__[key]
def __repr__(self):
return repr(self.__dict__)