Skip to content

Instantly share code, notes, and snippets.

@Tishka17
Tishka17 / .vimrc
Last active October 2, 2015 09:00 — forked from areinull/.vimrc
My vimrc
"Use Vim settings, rather then Vi settings (much better!).
"This must be first, because it changes other options as a side effect.
set nocompatible
"colors zenburn
set background=dark
set exrc
set secure
set mouse=a
set tabstop=4 shiftwidth=4 expandtab
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
set list listchars=tab:··
set number "show line numbers
highlight LineNr ctermfg=darkgrey guibg=darkgrey
@Tishka17
Tishka17 / formula.py
Created August 5, 2019 20:23
formula calculation
from collections import defaultdict
from enum import Enum
class TokenType(Enum):
LETTER = 0
NUMBER = 1
OPEN = 2
CLOSE = 3
from functools import partial
from logging import getLogger
from typing import Callable, Tuple, List, Optional
from vk_api import VkApi
from vk_api.longpoll import VkEventType, Event, VkLongPoll
from repo import Repository, UserState
Handler = Callable[[VkApi, Event, UserState], UserState]
@Tishka17
Tishka17 / core.py
Last active April 17, 2020 16:47
Transactional DB
class NullType:
def __repr__(self):
return 'NULL'
NULL = NullType()
class Db:
def __init__(self):
@Tishka17
Tishka17 / bot.ini
Last active November 8, 2020 11:16
Bot main and config
[tg_bot]
token =
admin_id =
support_chat_id =
service_chat_id =
homework_chat_id =
use_redis = true
[tg_admin]
api_id =
@Tishka17
Tishka17 / manager.py
Last active March 17, 2024 04:55
Multibot manager
import asyncio
from asyncio import get_running_loop, AbstractEventLoop
from contextvars import Context
from logging import getLogger
from typing import Dict, List
from aiogram import Dispatcher, Bot
from .database import Repo
from .handlers import register_sender
from __future__ import annotations
import os
from dataclasses import dataclass
from typing import List, Dict
import boto3
@dataclass
@Tishka17
Tishka17 / helper.py
Created August 17, 2021 14:34
Clooudpickle experiment
class Helper:
def do(self):
print(3)
@Tishka17
Tishka17 / mystr.py
Created September 14, 2021 09:21
Incorrect str inheritance
class MyString(str):
def __init__(self, data):
self.data = data
def append(self, other):
self.data += other
def __str__(self):
return self.data