Skip to content

Instantly share code, notes, and snippets.

Light My Fire!

Mikhail Kashkin xen

Light My Fire!
Block or report user

Report or block xen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Курс "Magic Python для начинающих"

Добро пожаловать на курс "Магия Python для начинающих"

Содержание лекций:

Вводная часть:

from web3 import Web3, HTTPProvider, IPCProvider
web3 = Web3(IPCProvider('/Users/xen/Library/Ethereum/rinkeby/geth.ipc'))
# web3 = Web3(IPCProvider('/Users/xen/Library/Ethereum/geth.ipc'))
xen /
Last active Jul 21, 2019
telegram site auth
# implementation of Telegram site authorization checking algorithm
# for more information
import collections
import hmac
import hashlib
def check_string(d, token):
secret = hashlib.sha256()
xen / jinja.json
Last active Jul 5, 2018
VS Code Jinja2 snippets
View jinja.json
"i18n": {
"prefix": "_",
"body": [
"{{ _('${TM_SELECTED_TEXT:${1:text}}') }}"
"description": "i18n"
"gt": {
"prefix": "gt",
xen /
Last active Aug 23, 2016
Алгоритм проверки ЕГРПОУ / Алгоритм перевіркі ЄДРПОУ
import operator
def check_erdpou(code):
""" Алгоритм проверки кода ЕРДПОУ """
code = int(code)
def check(sec, shift=False, step=0):
""" Генерация контрольного числа """
nums = list(range(1 + step, 8 + step))
if shift:
nums.insert(0, nums.pop(6))
xen /
Last active Jun 22, 2016
from objc_util import *
us = ObjCClass('UIScreen')
if us.mainScreen().scale() == 2.0:
elif us.mainScreen().scale() == 3.0:
print('iPhone 6 Plus')
print('Non retina')
View pip.conf
# cat ~/.pip/pip.conf
default-timeout = 60
respect-virtualenv = true
#download-cache = /home/xen/.pip/cache
log-file = /home/xen/.pip/pip.log
use-wheel = yes
find-links = /home/xen/.pip/wheels
xen / 1-usage.txt
Last active Sep 12, 2018
i18njson translate using Google Translate
View 1-usage.txt
$ python --help
Process and translate .po or JSON files and generate translated .po file
in result. Can work with exist .po files and if in initial file msgid
dissapear then mark translaed string as obsolete. Try to play nice with
version control systems and follow initial file order format, you will get
predicteable diffs.
xen / .gitconfig
Last active Aug 29, 2015
Git config
View .gitconfig
name = XX
email = X@X.X
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
xen /
Last active Jun 12, 2019
HTTP cache headers decorator for Flask
# example
from flask import json
from .utils import docache
@api.route('/jsonmethod', defaults={'count': 10})
@docache(hours=48, content_type='application/json')
def get_count(count):
# can be useable with JSON APIs
You can’t perform that action at this time.