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
# SQLite only storage for Dispatcher and telegram bots | |
from enum import Enum | |
from typing import Callable | |
from sqlalchemy import delete, Column, String, select, Enum as EnumSQLType, JSON | |
from sqlalchemy.orm import DeclarativeBase | |
from sqlalchemy.ext.asyncio import AsyncSession | |
from sqlalchemy.dialects.sqlite import insert | |
from aiogram.fsm.storage.base import BaseStorage, KeyBuilder, DefaultKeyBuilder, State, StateType |
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
<script setup lang="ts"> | |
const COUNT = 4 // Count of the bars | |
function r(min: number, max: number): number { | |
return Math.ceil(Math.random() * (max - min) + min) | |
} | |
</script> | |
<template> | |
<div class="music-chart-visualization"> | |
<div |
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
FROM python:3.10.5-slim-buster AS base | |
LABEL maintainer="https://github.com/somespecialone" | |
LABEL description="Poetry Dockerfile template" | |
ENV PYTHONDONTWRITEBYTECODE=1 \ | |
PYTHONUNBUFFERED=1 | |
FROM base AS builder |
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
# https://www.joeltok.com/blog/2021-3/building-an-event-bus-in-python | |
import asyncio | |
from typing import Callable, Coroutine, Generic, TypeVar, TypeAlias, Any | |
from warnings import warn | |
from inspect import iscoroutinefunction | |
_E = TypeVar("_E") | |
_Listener: TypeAlias = Callable[[...], Coroutine[Any, Any, None]] | Callable[[...], None] | |
_Waiter: TypeAlias = Callable[[...], bool] |
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
# https://pawamoy.github.io/posts/unify-logging-for-a-gunicorn-uvicorn-app/ | |
import sys | |
import logging | |
from loguru import logger | |
__all__ = ("setup_logging",) | |
_LOG_FORMAT = "{time:YYYY-MM-DD HH:mm:ss} <lvl>| {level: ^6} |</> {message}" |