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
| """ | |
| This is small script that (ab)uses Yandex Music Recognition. | |
| I hope the code is self-documented <3 | |
| Notice! Input file should be .ogg file, preferably with libopus encoder | |
| (untested with other encoders) | |
| (c) teidesu, 2019. This script is licensed under GPLv3 license. | |
| """ | |
| import lomond | |
| import uuid as uuid_py |
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
| #!/bin/bash | |
| current_branch=`git rev-parse --abbrev-ref HEAD` | |
| if [[ $current_branch =~ master|main ]]; then | |
| message="Please don't push directly to $current_branch." | |
| echo -e "\033[1;31mERROR: $message\033[0m"; | |
| exit 1 | |
| fi | |
| repo_dir=`git rev-parse --show-toplevel` |
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
| #!/bin/bash | |
| # | |
| # This script encapsulates the functionality of a queue. It requires there to be | |
| # an input file with the data in the queue being separated on different lines. | |
| # | |
| INPUT=queue.txt | |
| OUTPUT=trash.txt | |
| CMD=/usr/bin/vlc |
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
| from glob import glob | |
| import multiprocessing | |
| from concurrent.futures import ProcessPoolExecutor | |
| import cv2 | |
| from PIL import Image | |
| import imagehash | |
| from tqdm import tqdm |
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 cProfile | |
| def profileit(func): | |
| """ | |
| Decorator (function wrapper) that profiles a single function | |
| @profileit() | |
| def func1(...) | |
| # do something | |
| pass |
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
| """ | |
| This gist shows how to run asyncio loop in a separate thread. | |
| It could be useful if you want to mix sync and async code together. | |
| Python 3.7+ | |
| """ | |
| import asyncio | |
| from datetime import datetime | |
| from threading import Thread | |
| from typing import Tuple, List, Iterable |