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
| aws ecr get-login | sed 's|https://||' | |
| # Remember to delete the -e |
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
| from django.db import connection | |
| print(len(connection.queries)) | |
| from django.db import reset_queries | |
| reset_queries() |
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 ls-files --deleted -z | xargs -0 git rm |
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
| sudo apt-get install libpq-dev |
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
| sudo apt-get install libmysqlclient-dev |
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
| sudo apt-get build-dep python-imaging | |
| sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/ | |
| sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/ | |
| sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/ |
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
| from PIL import Image | |
| from rest_framework.test import APIRequestFactory, force_authenticate | |
| class TestPostVetListCreateView: | |
| factory = APIRequestFactory() | |
| def test_request_post(self): | |
| image = Image.new('RGB', (1000, 1000), 'white') | |
| tmp_file = tempfile.NamedTemporaryFile(suffix='.jpg') | |
| image.save(tmp_file) |
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 string | |
| import random | |
| def StringGenerator(size=50): | |
| chars=string.ascii_uppercase + string.digits | |
| return ''.join(random.choice(chars) for _ in range(size)) |