This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# virtualenv | |
virtualenv_find_and_activate() { | |
local ENV_DIR="env" | |
[ ! -z "${1}" ] && ENV_DIR=$1 | |
local CURRENT=$(pwd) | |
local ROOT=${CURRENT} | |
local RESULT=0 | |
while [ "${ROOT}" != "/" ] && [[ "${RESULT}" == 0 ]]; do | |
local DIRS=( "${ROOT}/${ENV_DIR}" "${ROOT}_${ENV_DIR}" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
.PHONY: lint-yml | |
lint-yml: ## Lints all yaml files with yamllint docker image | |
@echo "* Lint YAML" | |
@yamllint -f parsable -c .yamllint . | |
@echo "done" | |
.PHONY: check-isort | |
check-isort: ## Check isort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import toml | |
def convert(): | |
data = toml.load("pyproject.toml") | |
result = [] | |
for package_name, params in data["tool"]["poetry"]["dependencies"].items(): | |
if package_name == "python": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import logging | |
import os | |
import uuid | |
from copy import deepcopy | |
from django.conf import settings | |
from django.core.management import BaseCommand | |
from wagtail.core.models import Page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MASTER] | |
profile=no | |
persistent=yes | |
ignore=migrations | |
cache-size=500 | |
[MESSAGES CONTROL] | |
# C0111 Missing docstring | |
# E1120 No value passed for parameter 'cls' infunction call | |
# I0011 Warning locally suppressed using disable-msg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
# Write a function that accepts 2 arrays. | |
# The arrays contain numbers and each input array is already sorted in increasing order. | |
# The function should create and return another array | |
# which contains all of the numbers that are in the 2 input arrays. | |
# The numbers in the returned array should also be sorted in increasing order. | |
# The goal is to write code that executes as fast as possible for large arrays. | |
# Implement without using any third party libraries. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше | |
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после | |
# каждого слова из шести букв должен стоять значок «™». Примерно так: | |
# | |
# http://habrahabr.ru/company/yandex/blog/258673/ | |
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import functools | |
import hashlib | |
import logging | |
import tornado.web | |
import tornado.gen | |
import tornado.httpclient | |
import tornado.ioloop |