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
| var ARRAY_LENGTH = 16; | |
| var MIN_HEX_LENGTH = 2; | |
| class UUID { | |
| static createUUID() { | |
| const array = new Uint8Array(ARRAY_LENGTH); | |
| window.crypto.getRandomValues(array); | |
| let uuid = ''; |
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
| import asyncio | |
| from asyncio.queues import Queue | |
| TERMINATOR = object() | |
| class TaskPool(object): | |
| def __init__(self, loop, num_workers): | |
| self.loop = loop | |
| self.tasks = Queue(loop=self.loop) |
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
| /var/log/supervisor/*.log { | |
| weekly | |
| rotate 52 | |
| compress | |
| delaycompress | |
| notifempty | |
| missingok | |
| copytruncate | |
| } |
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 docker.io/python:3.9-bullseye AS build | |
| WORKDIR "/app" | |
| # Install dependecies | |
| # hadolint ignore=DL3008,DL3013 | |
| RUN set -eux && \ | |
| apt-get update; \ | |
| apt-get install --no-install-recommends -y \ | |
| python3-dev build-essential patchelf upx; \ | |
| apt-get clean; \ |
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 pyrogram import Client, filters | |
| app = Client('CONVERSATION_EXAMPLE') | |
| conversations = {} | |
| infos = {} | |
| def conv_filter(conversation_level): | |
| def func(_, __, message): | |
| return conversations.get(message.from_user.id) == conversation_level |
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
| [DEFAULT] | |
| ; Operation mode | |
| ; This is a global value for all sections | |
| mode = master | |
| [server] | |
| ; Connection lifetime | |
| timeout = 3600 |
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
| import time | |
| import uuid | |
| class PrintRandom(object): | |
| def execute(self) -> None: | |
| while True: | |
| self.print_number(uuid.uuid1().int) | |
| time.sleep(1) |
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
| var ARRAY_LENGTH = 16; | |
| var MIN_HEX_LENGTH = 2; | |
| class UUID { | |
| static createUUID() { | |
| const array = new Uint8Array(ARRAY_LENGTH); | |
| window.crypto.getRandomValues(array); | |
| let uuid = ''; |
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
| [package] | |
| name = "test" | |
| version = "0.1.0" | |
| authors = ["YOU <YOU@users.noreply.github.com>"] | |
| edition = "2018" | |
| [lib] | |
| crate-type = ["cdylib"] |
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
| import asyncio | |
| from collections import deque | |
| class AsyncioPool: | |
| def __init__(self, concurrency, loop=None): | |
| """ | |
| @param loop: asyncio loop | |
| @param concurrency: Maximum number of concurrently running tasks | |
| """ |
OlderNewer