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
""" | |
This gist shows how to run asyncio loop in a separate thread. | |
It could be useful if you want to mix sync and async code together. | |
Python 3.7+ | |
""" | |
import asyncio | |
from datetime import datetime | |
from threading import Thread | |
from typing import Tuple, List, Iterable |
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 python3.7 | |
""" | |
Usage: pipenvlink path/to/script.py | |
Result: bash file named 'script' that runs script.py in its venv from anywhere | |
""" | |
import os | |
import sys | |
from pathlib import Path |
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/bash | |
set -euo pipefail | |
# This script will remove automatic association for all networks not listed in the whitelist | |
# passed as the first argument. Passwords will NOT be removed from the Keychain. | |
# | |
# Alternatively, you can untick "Remember networks" in Network Preferences > Wi-Fi > Advanced, | |
# but then you won't be able to auto-join networks even temporarily, and you might already | |
# have a long list to go through. | |
# |