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
{ | |
"vim.normalModeKeyBindings": [ | |
{ | |
"before": ["J"], | |
"after": ["5", "j"] | |
}, | |
{ | |
"before": ["K"], | |
"after": ["5", "k"] | |
} |
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
from sqlalchemy import create_engine | |
engine = create_engine( | |
f"postgresql://{connection.user}:{connection.password}@{connection.host}/{connection.database}", | |
) | |
df.to_sql(name=name, con=engine, if_exists="replace", index=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
from sqlalchemy import create_engine | |
engine = create_engine( | |
f"postgresql://{connection.user}:{connection.password}@{connection.host}/{connection.database}", | |
) | |
query = f'SELECT * FROM "{name}"' | |
df = pd.read_sql(query, con=engine) |
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
install: | |
@echo "Installing..." | |
poetry install | |
activate: | |
@echo "Activating virtual environment" | |
poetry shell | |
pull_data: | |
@echo "Pulling data..." |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/khuyen/.oh-my-zsh" | |
# Path to VSCOde | |
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" | |
export PATH="$PATH:/Library/Python/3.9/lib/python/site-packages" |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
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
repos: | |
- repo: https://github.com/psf/black | |
rev: 22.1.0 | |
hooks: | |
- id: black | |
additional_dependencies: ['click==8.0.4'] | |
- repo: https://github.com/pycqa/flake8 | |
rev: 3.8.4 | |
hooks: | |
- id: flake8 |
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: install_format_packages download_config add_precommit install_git_hooks | |
poetry: poetry_install_format_packages download_config add_precommit install_git_hooks | |
pip_install_format_packages: | |
pip install pre-commit commitizen | |
poetry_install_format_packages: | |
poetry add -D pre-commit commitizen | |
download_config: | |
wget -O .flake8 https://gist.githubusercontent.com/khuyentran1401/f4a4c822320a9db266ad935b501be66e/raw/3ebf2b029490a970591caa733dd9d2e9767b184e/.flake8 |
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
[tool.black] | |
line-length = 79 | |
include = '\.pyi?$' | |
exclude = ''' | |
/( | |
\.git | |
| \.hg | |
| \.mypy_cache |
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
''' | |
Example of Wrappers | |
''' | |
from functools import wraps | |
from datetime import datetime | |
import time | |
def verbose_timeit(func): | |
@wraps(func) |
NewerOlder