Skip to content

Instantly share code, notes, and snippets.

@rupython
rupython / main.py
Created January 29, 2019 07:31
From: Павел
def make_paste(content, holder, file_name='main.py'):
headers = {'Authorization': f'token {config.GIT_TOKEN}'}
payload = {
'description': f'From: {holder}',
'public': True,
'files': {
file_name: {
'content': content
}
}
@rupython
rupython / t.txt
Created January 29, 2019 07:37
From: Павел
1010
@rupython
rupython / models.py
Created January 29, 2019 08:07
From: Павел
import peewee
db = peewee.SqliteDatabase('users.db')
class BaseModel(peewee.Model):
class Meta:
database = db
@rupython
rupython / main.py
Created January 29, 2019 12:20
From: Павел
def encode(url_id):
result = []
while url_id > 0:
val = url_id % base
result.append(alphabet[val])
url_id //= base
return ''.join(result[::-1])
@rupython
rupython / PyrogramChat_57148.txt
Created January 29, 2019 13:21
From: Павел
[['-', <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f27f0>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2860>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f28d0>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2940>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f29b0>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2a20>], [<pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2a90>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2b00>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2b70>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2be0>, <pyrogram.client.types.bo
@rupython
rupython / main.py
Created January 29, 2019 19:12
From: Ярик
import copy
class Text(object):
def __init__(self):
self.text = ''
self.font = ''
def write(self, text):
self.text += text
@rupython
rupython / deckstop.py
Created January 30, 2019 14:25
From: Андр
from tkinter import *
import pymysql.cursors
import pymysqlpool
# Подключение к БД
connection = pymysql.connect(host='127.0.0.1',
user='root',
password='',
db='python',
@rupython
rupython / main.py
Created January 31, 2019 18:06
From: 󠀡󠀡
Есть такой говно-код:
@bot.message_handler(commands=['newbh'])
def add(message):
banhammer = message.text.replace('/newbh ', '')
if banhammer != '':
banhammers = open(str(message.chat.id) + '.txt', 'w')
banhammers.write(banhammer)
banhammers.close()
@bot.message_handler(commands=['listbh'])
@rupython
rupython / main.py
Created February 1, 2019 19:24
From: Artemy
print("Just testin'")
@rupython
rupython / main.py
Created February 1, 2019 19:33
From: Artemy
print("Just testin'")