Skip to content

Instantly share code, notes, and snippets.

View avdotion's full-sized avatar
🚩
Available in t.me/avdotion

Danila Avdoshin avdotion

🚩
Available in t.me/avdotion
  • Moscow, Russia
View GitHub Profile
@avdotion
avdotion / cell.js
Last active June 11, 2018 14:29
Maze generation algorithm (Recursive backtracker) (p5.js)
class Cell {
constructor(i, j) {
this.i = i;
this.j = j;
this.walls = {
top: true,
right: true,
bottom: true,
left: true,
}
@avdotion
avdotion / styles.less
Last active June 26, 2018 17:25
Atom Settings for Operator Mono and Fira Code fonts
// Fira Code (Free)
// https://github.com/tonsky/FiraCode
// Operator Fonts (Paid)
// https://www.typography.com/fonts/operator/overview/
// you can manually enable/disable my styles by colors
//
// add next lines to your atom stylesheet
@avdotion
avdotion / keys.py
Last active February 27, 2018 19:49
Решения задач ЕГЭ (27) c сайта К. Полякова (http://kpolyakov.spb.ru)
# -*- coding: utf-8 -*-
# Демонстрация альтернативных способов решения задач ЕГЭ (27) на языке Python 3
# с сайта К. Полякова. Исправления и рекомендации приветствуются!
"""
-------------------------------------------------
Задача C4-70.
Решение на языке Python 3.
-------------------------------------------------
@avdotion
avdotion / number.py
Created February 20, 2018 15:11
Перевод из одной системы счисления в другую
class Number:
def __init__(self, value, base):
'''Конструктор класса'''
# Проверка на тип
# Класс основан на работе со списком значений (цифр числа)
# На этом шаге ~любой тип преобразуется в список строк
if isinstance(value, type(1)):
self.value = list(str(value))
elif isinstance(value, type([])):
self.value = value
@avdotion
avdotion / bot.py
Last active December 3, 2017 11:10
Общажный бот (Telegram Bot)
import telebot
import datetime
import random
import time
token = ''
bot = telebot.TeleBot(token)
# Идентификаторы чатов, для которых разрешен доступ
ACCESS_CHAT_ID = {-1001093224903, 126491903}
@avdotion
avdotion / binary_heap.py
Created August 29, 2017 15:38
Binary Heap
# Структура данных "Двоичная куча (Binary Heap)"
# https://habrahabr.ru/post/112222/
class Heap:
def __init__(self, data=[]):
# Функция построение кучи O(N)
self.data = data
for i in range(len(self.data) // 2, -1, -1):
self.heapify(i)