Skip to content

Instantly share code, notes, and snippets.

@rupython
rupython / logging_bug.py
Created January 7, 2021 15:18
From: Dima
import logging
import gunicorn.app.base
from fastapi import FastAPI
from loguru import logger
class InterceptHandler(logging.StreamHandler):
def emit(self, record):
# Get corresponding Loguru level if it exists
@rupython
rupython / 1.py
Created May 29, 2021 14:57
From: Djimbo
import sys
import importlib
import asyncio
import binascii
from bitstring import BitArray, ConstBitStream
import protocol
import random
import html
import time
from time import mktime
@rupython
rupython / seeker.py
Created September 22, 2019 15:03
From: Radomir Kot
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import csv
import sys
import time
import json
import argparse
import requests
@rupython
rupython / main.py
Created June 19, 2021 14:13
From: ♡༺ErVinTract༻♡
def extract_unique_code(text):
# Extracts the unique_code from the sent /start command.
return text.split()[1] if len(text.split()) > 1 else None
create_tables()
@dp.message_handler(commands=["start"], state="*")
async def user_registration(message: types.Message):
register_user(message.from_user.id, message.from_user.username, message.from_user.first_name, message.from_user.last_name)
#Выделение id рефера
@rupython
rupython / 27-67a.txt
Created June 14, 2021 15:08
From: Saliws
31
3 35 21 14
3 47 27 68
2 83 30
2 39 86
3 24 93 54
2 35 98
2 12 10
4 10 29 49 92
6 82 25 91 55 87 84
import pygame as pg
from random import randint, choice
from pgex.widgets import Text
from pgex.parameters import colors
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
FPS = 60
@rupython
rupython / Код.txt
Created June 14, 2021 09:50
From: Юродь
import pygame as pg
from random import randint, choice
from pgex.widgets import Text
from pgex.parameters import colors
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
FPS = 60
@rupython
rupython / models.py
Created June 14, 2021 01:50
From: 🦖
from django.db import models
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
User = get_user_model()
#settings.AUTH_USER_MODEL
#*******
#1 Category
#2 Product
#3 CartProduct
#4 Cart
import pygame as pg
from pgex.parameters import colors
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
FPS = 60
pg.init()
screen = pg.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
@rupython
rupython / cj.py
Created June 6, 2021 17:50
From: Иван
import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
import random
import time
import vkcoin
token = "a6dc463f2e34dd52b2345f06891046d136800292b9a1b86dc4cfb80e0e318f6897b08d24ca78bc7fd3ccf" # токен от группы
vk_session = vk_api.VkApi(token=token)
session_api = vk_session.get_api()
vk = vk_api.VkApi(token=token)