This file contains hidden or 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
| # Thanks to me | |
| import asyncio | |
| from fastapi import FastAPI | |
| from request_coalescer import coalesce | |
| app = FastAPI(lifespan=lifespan) |
This file contains hidden or 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 hidden or 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 hidden or 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.13-slim AS base | |
| LABEL maintainer="https://github.com/somespecialone" | |
| LABEL description="Poetry Dockerfile template" | |
| FROM base AS builder | |
| RUN apt-get update && apt-get install --no-install-recommends -y curl | |
| ENV POETRY_VERSION=2.1.3 \ |
This file contains hidden or 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 hidden or 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 typing import Sequence | |
| from loguru import logger | |
| LOG_FORMAT = "{time:YYYY-MM-DD HH:mm:ss} <lvl>| {level: ^6} |</> {message}" |