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
# Sample Nginx config with sane caching settings for modern web development | |
# | |
# Motivation: | |
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
# and juicy version of your assets available. | |
# At some point, however, you want to show your work to testers, your boss or your client. | |
# After you implemented and deployed their feedback, they reload the testing page – and report | |
# the exact same issues as before! What happened? Of course, they did not have developer tools | |
# open, and of course, they did not empty their caches before navigating to your site. |
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
import datetime | |
DATE_SYSTEM_1900_EPOCH = datetime.datetime(1899, 12, 31) | |
DATE_SYSTEM_1904_EPOCH = DATE_SYSTEM_1900_EPOCH + datetime.timedelta(days=1462) | |
def _handle_excel_date_system( | |
ordinal: Union[str, float], | |
_epoch: datetime.datetime | |
) -> Optional[datetime.datetime]: |
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
# see what's the bluetooth status | |
bluetoothctl | |
# bluetooth config | |
sudo vi /etc/bluetooth/main.conf | |
# list wireless devices and if they are enabled | |
rfkill list | |
# hard reset of bluetooth |
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
#!/usr/bin/env bash | |
# run from terminal with | |
# bash <(curl -Ls gist.githubusercontent.com/tomwojcik/549ddf72117127e54b8317f690954072/raw/1e609d631bffd12aa4e4e526e789821ae6650167/nuke_docker_env.sh) | |
echo "Stopping all running containers" | |
docker stop $(docker ps -aq) > /dev/null | |
echo "Removing all containers" | |
docker rm $(docker ps -aq) > /dev/null |
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
#!/usr/bin/env bash | |
find . -name '*.pyc' -exec rm -f {} + | |
find . -name '*.pyo' -exec rm -f {} + | |
find . -name '*~' -exec rm -f {} + |
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
#!/usr/bin/env bash | |
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete | |
find . -path "*/migrations/*.pyc" -delete | |
find . -path "*/*.sqlite3" -delete | |
echo "Finished." |