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
| """ | |
| Django ORM Optimization Tips | |
| Caveats: | |
| * Only use optimizations that obfuscate the code if you need to. | |
| * Not all of these tips are hard and fast rules. | |
| * Use your judgement to determine what improvements are appropriate for your code. | |
| """ | |
| # --------------------------------------------------------------------------- |
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
| " _ _ " | |
| " _ /|| . . ||\ _ " | |
| " ( } \||D ' ' ' C||/ { % " | |
| " | /\__,=_[_] ' . . ' [_]_=,__/\ |" | |
| " |_\_ |----| |----| _/_|" | |
| " | |/ | | | | \| |" | |
| " | /_ | | | | _\ |" | |
| It is all fun and games until someone gets hacked! |
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
| Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
| The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
| The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
| To use: | |
| 1. Install [Ansible](https://www.ansible.com/) | |
| 2. Setup an Ubuntu 16.04 server accessible over ssh | |
| 3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
| 4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
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
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def hello(): | |
| await asyncio.sleep(3) | |
| print('Hello!') | |
| if __name__ == '__main__': | |
| loop.run_until_complete(hello()) | |