# https://github.com/pyenv/pyenv
brew install pyenv
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)”; fi' >> ~/.zshrc
# https://github.com/pyenv/pyenv/wiki
pyenv install 2.7.8
This file contains 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
#!/bin/sh | |
# | |
# An example hook script to prepare the commit log message. | |
# Called by "git commit" with the name of the file that has the | |
# commit message, followed by the description of the commit | |
# message's source. The hook's purpose is to edit the commit | |
# message file. If the hook fails with a non-zero status, | |
# the commit is aborted. | |
# | |
# To enable this hook, rename this file to "prepare-commit-msg". |
This file contains 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
pip freeze | comm -13 ./requirements/base.txt - > ./requirements/dev.txt |
This file contains 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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'colored': { | |
'()': 'colorlog.ColoredFormatter', | |
'format': "%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s", | |
'log_colors': { | |
'DEBUG': 'bold_black', | |
'INFO': 'white', |
This file contains 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.autoComplete.addBrackets": true, | |
"python.formatting.blackPath": "${env:HOME}/Library/Python/3.7/bin/black", | |
"python.formatting.provider": "black", | |
"python.linting.enabled": true, | |
"python.linting.pylintEnabled": true, | |
"python.linting.pylintPath": "${env:HOME}/Library/Python/3.7/bin/pylint", | |
"python.poetryPath": "${env:HOME}/Library/Python/3.7/bin/poetry", | |
"python.pythonPath": ".venv/bin/python", | |
"python.testing.nosetestsEnabled": false, |
This file contains 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
[ | |
{ | |
"model": "persons.person", | |
"pk": 1, | |
"fields": { | |
"last_name": "Гагарин", | |
"first_name": "Юрий", | |
"middle_name": "Алексеевич", | |
"dob": "1934-03-09" | |
} |
This file contains 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
yarn create react-app ... | |
yarn add -D eslint-config-prettier eslint-plugin-prettier husky lint-staged prettier pretty-quick |
This file contains 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
ctx.fillStyle = | |
"#" + | |
( | |
((Math.cos(r) * 127 + 128) << 16) | | |
((Math.cos(r + pi2 / 3) * 127 + 128) << 8) | | |
(Math.cos(r + (pi2 / 3) * 2) * 127 + 128) | |
).toString(16); |
This file contains 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
// drop leading zeroes from array | |
// TODO: make as polyfill | |
// e.g. https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/filter#Polyfill | |
const dropWhile = arr => arr.reduce( | |
(state, v) => (v === 0 && state.drop | |
? ({ arr: [...state.arr], drop: true }) | |
: ({ arr: [...state.arr, v], drop: false })), { arr: [], drop: true }, | |
).arr; |
NewerOlder