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
| # Run in your shell (with virtual environment active) | |
| python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())' |
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
| # Method 1 | |
| echo "Running command" | |
| my_command # use your command here | |
| if [ $? -ne 0 ]; then { echo "Failed, aborting." ; exit 1; } fi | |
| # Method 2 (Same as method 1, but with else block) | |
| my_command # use your command here | |
| if [ $? -eq 0 ] | |
| then |
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
| find . -path "*/migrations/*.py" -not -name "__init__.py" -not -path "./*env/*" |
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.defaultInterpreterPath": "venv/bin/python", | |
| "python.linting.pylintEnabled": false, | |
| "python.linting.flake8Enabled": true, | |
| "python.linting.enabled": true, | |
| "python.linting.flake8Args": [ | |
| "--max-line-length=120", | |
| "--ignore=E501, E402, E731, W503, W504" | |
| ], | |
| "python.linting.pylintArgs": [ |
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
| <!-- based on codes provided on https://www.netflix-codes.com/ --> | |
| <!-- DO NOT USE ANY AUTO FORMATTING OR THE BOOKMARK FILE WON'T WORK --> | |
| <DL> | |
| <H3>Netflix Codes</H3> | |
| <DL> | |
| <H3>Action & adventure</H3> | |
| <DL> | |
| <A HREF="https://www.netflix.com/browse/genre/1365" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABtUlEQVQ4jYWTTWtTYRCFnzP3JmkTkmCRVnHlRsG/4E5w5broj9H/oxbciChUcOVeXVTciWCjlqC2NL2Se+e4SIXmo/Xshpd5OO+ZGQCeQgGwVw4e/upseNTZyK/tSx/3oQvwvDV4/bI19G576Ffl4NHZngDYYaYvmapsGjztoBsue7cB5AwAzJICYPu0OAk8timtphRRqPVg9iKMQecAzhQ6sJnaRWU7iXuGtQYqWeBlC3OAdeDIySFWiqYrtn4W/bu/7ZNCXmlh0QFI7DtVGCS5ifL+caYaW14RwhygJugIvmW6gpg4sXQH4tYEHOeF+E9J0jJMsH5kgrDxlQ3p5qFdF/rvFwIk2pI/Z0YYWfh6RFa2sMmLAABp00fl2P4kNLLRVgQ9yVNBLCCWAI2gJ8nknu03XQVrkFsK/TGUCy1LACEK4V6EI+sntpUS1xS2DXmBA5E2pjHqS+uXm6Pdifkuuxgi9xWcxPwsF6YQSLJFltARVEG+WEOUUr0pucrZNu2sAohU2GpZIegANJ4+Rsiiu6nQ4PSktlcBErI24yQ/yH4HMKqP39YNz1rp9wUeX4352P4CWRLiC+ie/GoAAAAASUVORK5CYII">** Action & adventure **</A> | |
| <A HREF="https://www.netflix. |
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
| """ | |
| To use, install termcolor using pip: | |
| $ python -m pip install termcolor | |
| copy and paste the following in your code | |
| # region Logging | |
| import logging | |
| from colored_logger import get_logger | |
| fname = Path(__file__).stem |
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
| class ColorConsole: | |
| HEADER = "\033[95m" | |
| OKBLUE = "\033[94m" | |
| OKCYAN = "\033[96m" | |
| OKGREEN = "\033[92m" | |
| WARNING = "\033[93m" | |
| FAIL = "\033[91m" | |
| ENDC = "\033[0m" | |
| BOLD = "\033[1m" | |
| UNDERLINE = "\033[4m" |
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
| touch2() { mkdir -p "$(dirname "$1")" && touch "$1" ; } |
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
| lazygit() { | |
| git add . | |
| git commit -a -m "$1" | |
| git push | |
| } |
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
| # fzf from https://github.com/junegunn/fzf | |
| # diff-so-fancy from https://github.com/so-fancy/diff-so-fancy | |
| gcop() { | |
| git log \ | |
| --reverse \ | |
| --color=always \ | |
| --format="%C(cyan)%h %C(blue)%ar%C(auto)%d% C(yellow)%s%+b %C(magenta)%ae" "$@" | | |
| fzf -i -e +s \ | |
| --reverse \ |
NewerOlder