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
https://www.aeracode.org/2018/02/19/python-async-simplified/ | |
def get_chat_id(name): | |
# blocking code | |
return Chat.objects.get(name=name).id | |
async def main(): | |
executor = concurrent.futures.ThreadPoolExecutor(max_workers=3) | |
loop = asyncio.get_event_loop() | |
result = await loop.run_in_executor(executor, get_chat_id, "django") |
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
# https://blog.adriel.co.nz/2018/01/25/change-docker-data-directory-in-debian-jessie/ | |
sudo nano /etc/docker/daemon.json | |
{ | |
"data-root": "/new/path/to/docker-data" | |
} | |
sudo systemctl stop docker | |
sudo rsync -axPS /var/lib/docker/ /new/path/to/docker-data |
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
git submodule add https://github.com/facebook/duckling libs/duckling | |
git add libs/duckling | |
git commit -m "add duckling module" | |
git submodule update --init libs/duckling/ |
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 remove a submodule you need to: | |
Delete the relevant section from the .gitmodules file. | |
Stage the .gitmodules changes git add .gitmodules | |
Delete the relevant section from .git/config. | |
Run git rm --cached path_to_submodule (no trailing slash). | |
Run rm -rf .git/modules/path_to_submodule (no trailing slash). | |
Commit git commit -m "Removed submodule " | |
Delete the now untracked submodule files rm -rf path_to_submodule |