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
| version: '2' | |
| services: | |
| hitchhiker: | |
| image: brookshi/hitchhiker:v0.14 | |
| container_name: hitchhiker | |
| environment: | |
| - HITCHHIKER_DB_HOST=localhost | |
| - HITCHHIKER_APP_HOST=http://localhost:9999/ | |
| ports: | |
| - "9999:9999" |
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
| Разница между процессом и тредом | |
| Виртуализация, разница между контейнеризация и вирт | |
| В каком случае python не совсем интерпритируемый | |
| Микросервисы vs монолит | |
| Python GIL | |
| Файловые дескрпторы | |
| Типы данных Python | |
| ООП и функциональный стиль | |
| Замыкания и partial | |
| SQL и NoSQL, разница |
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
| local Plug = vim.fn['plug#'] | |
| vim.call('plug#begin', '~/.config/nvim/plugged') | |
| Plug 'vim-airline/vim-airline' | |
| Plug 'kyazdani42/nvim-web-devicons' -- for file icons | |
| Plug 'kyazdani42/nvim-tree.lua' | |
| Plug 'goolord/alpha-nvim' | |
| Plug 'marko-cerovac/material.nvim' | |
| Plug 'romgrk/barbar.nvim' | |
| Plug 'akinsho/toggleterm.nvim' | |
| Plug 'nvim-lua/plenary.nvim' |
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
| # install dependencies | |
| pip install requests bottle | |
| # server.py | |
| import json | |
| from bottle import run, response, post | |
| @post("/test") | |
| def index(): |
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 math | |
| def merge(one, two): | |
| n = max(len(one), len(two)) | |
| i, j = 0, 0 | |
| result = [] | |
| for _ in range(n * 2): | |
| a = one[i] if len(one) > i else None | |
| b = two[j] if len(two) > j else None |
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 math | |
| def karatsuba(x, y): | |
| if (x < 10) and (y < 10): | |
| return x * y | |
| n = max(len(str(x)), len(str(y))) | |
| n2 = int(math.ceil(float(n) / 2)) |
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
| # create .pgpass in your home directory with same content | |
| localhost:5432:your_db_name:your_db_username:password | |
| # set required permissions for this file | |
| sudo chmod 600 .pgpass | |
| # set PGPASSFILE variable in your .bashrc or in .zshrc | |
| export PGPASSFILE='/home/your_user/.pgpass' | |
| # test your .pgpass |
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
| # paste this in your postgresql.conf | |
| # in my way it is in /etc/postgresql/9.5/main/postgresql.conf | |
| shared_preload_libraries = 'pg_stat_statements' | |
| track_activity_query_size = 2048 | |
| pg_stat_statements.track = all | |
| # after this you must restart postgresql daemon | |
| sudo service postgresql restart | |
| # connect to your db with psql and create extension |
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
| EMAIL_USE_TLS = True | |
| EMAIL_HOST = 'smtp.yandex.ru' | |
| EMAIL_HOST_USER = '[email protected]' | |
| EMAIL_HOST_PASSWORD = 'your_password' | |
| EMAIL_PORT = 587 | |
| DEFAULT_FROM_EMAIL = EMAIL_HOST_USER |
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
| CREATE USER 'username' WITH PASSWORD 'password'; | |
| ALTER USER 'username' SUPERUSER; | |
| CREATE DATABASE 'dbname' WITH ENCODING 'UTF8' LC_CTYPE 'en_US.UTF-8' LC_COLLATE 'en_US.UTF-8' TEMPLATE template0 OWNER 'username'; |