Skip to content

Instantly share code, notes, and snippets.

View theruziev's full-sized avatar
🎷
Jazz things

Bakhtiyor Ruziev theruziev

🎷
Jazz things
View GitHub Profile
@theruziev
theruziev / .php_cs
Created December 11, 2017 08:34 — forked from jwage/.php_cs
php-cs-fixer git pre commit hook
<?php
$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PHP56Migration' => true,
'@PHPUnit60Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
@theruziev
theruziev / php-cs-fixer
Created December 11, 2017 09:08 — forked from mpalourdio/php-cs-fixer
@fabpot php-cs-fixer config for PhpStorm
parameters
--level=psr2 --verbose fix $FileDir$/$FileName$
working directory
$ProjectFileDir$
@theruziev
theruziev / tarantool.md
Created August 23, 2018 07:43 — forked from spugachev/tarantool.md
Введение в работу с Tarantool

Работа с Tarantool

Начать работу с Tarantool можно запустив обучающий туториал на официальном сайте https://tarantool.org/en/try.html

Это позволяет попробовать Tarantool прямо из браузера сразу и без регистрации. Также на официальном сайте представлены инструкции по установке и запуску Tarantool в macOS, популярных дистрибутивах Linux и FreeBSD. Версии для Windows Tarantool не имеет.

Но не спешите сразу устанавливать Tarantool непосредственно в операционную систему. Самым удобным способом быстро запустить и попробовать Tarantool на Linux, macOS или Windows является Docker. Если у вас уже установлен Docker, то запуск контейнера с Tarantool может быть выполнен одной командой:

docker run --name mytarantool -d tarantool/tarantool:1.7
@theruziev
theruziev / tokens.md
Created October 26, 2018 04:30 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Preconditions:

В данной заметке рассматривается работа JWT с симметичным алгоритмом шифрования (HS256/HS384/HS512)

Основы:

Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им логина/пароля с данными сохранёнными в базе данных.

Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.

@theruziev
theruziev / README-Template.md
Created October 28, 2018 08:00 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@theruziev
theruziev / pypi.md
Created November 4, 2018 23:21 — forked from gboeing/pypi.md
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
@theruziev
theruziev / aiohttp_fixture.py
Created November 13, 2018 08:09
aiohttp client fixture with pytest-asyncio compatibility
import pytest
from aiohttp.test_utils import TestServer, TestClient
@pytest.fixture
async def aio_client():
clients = []
async def factory(app):
server = TestServer(app)
@theruziev
theruziev / main.py
Created March 7, 2019 12:33
main.py
from aiohttp import web
async def handle(request):
name = request.match_info.get('name', "Anonymous")
text = "Hello, " + name
return web.Response(text=text)
app = web.Application()
app.add_routes([web.get('/', handle),
@theruziev
theruziev / clickhouse.sql
Last active June 21, 2019 15:35
Clickhouse TIPs
# Range date
SELECT toDate(toStartOfDay(toDate(toUnixTimestamp(now()) + (number * 86400)))) date FROM numbers(10);

Keybase proof

I hereby claim:

  • I am theruziev on github.
  • I am theruziev (https://keybase.io/theruziev) on keybase.
  • I have a public key ASBvONwp6Whi7sPJ-1J58112bmYW9tUiETVnqjronhE7Ego

To claim this, I am signing this object: