Skip to content

Instantly share code, notes, and snippets.

View kndo's full-sized avatar
🎯
Focusing

Khanh Do kndo

🎯
Focusing
  • Bay Area, CA
View GitHub Profile
@kndo
kndo / find_and_replace.sh
Last active April 9, 2019 00:18
find and replace on macOS
find . -type f -name '*' -exec sed -i '' 's/an old string/a new string/g' {} +
@kndo
kndo / .gitignore
Last active June 10, 2019 05:28
a .gitignore for Python projects
venv/
build/
dist/
*.egg-info/
.vscode/
__pycache__/
*.pyc
*.swp
@kndo
kndo / key_bindings.json
Last active April 10, 2019 23:46
use <Tab> to toggle auto-complete suggestions in VSCode
[
{
"key": "tab",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "shift+tab",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
@kndo
kndo / gist:a020481b1c2ede57f71f74362a5a2cf1
Created June 13, 2019 22:51
Show project structure for a Python project
tree -I '*pyc' -I '__pycache__'
@kndo
kndo / flask-apscheduler-factory-pattern.py
Created August 2, 2020 09:43
Example of flask + apscheduler factory pattern
# app.py
from flask import Flask
from .scheduler import register_scheduler # Assuming in same directory as app.py
def create_app():
app = Flask(__name__)
register_scheduler(app)
return app
@kndo
kndo / .bash_aliases
Created November 21, 2020 04:36
My useful bash aliases
# dirs
alias cd1="cd .."
alias cd2="cd ../../"
alias cd3="cd ../../../"
alias cd4="cd ../../../../"
alias cd5="cd ../../../../../"
# files/dirs
alias rm="rm -i"
alias mv="mv -i"