Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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)
@rupython
rupython / cj.py
Created June 6, 2021 15:19
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)
amqp==5.0.6
asgiref==3.3.4
billiard==3.6.4.0
celery==5.1.0
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
@rupython
rupython / kNN.py
Created June 5, 2021 12:48
From: Jampik
import numpy as np
import math
# классификация методом k ближайших соседей
# X - обучающее множество.
# Строки соответствуют объектам,
# столбцы - признакам.
# Последний столбец - номер класса
# k - количество ближайших соседей (не более числа объектов в X)