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
| [[ "${CHECK}" == "prod" ]] && TEST=5 || TEST=10 |
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
| 1. use docker history ${IMAGE} | |
| 2. Use dive | |
| 3. Use pip --no-cache-dir to prevent writing pip cache -> decrease images. | |
| 4. Chain RUN statement for temp | |
| 5. Changes to source code invalidate the build cache | |
| 6. Hadolint: Dockerfile linter | |
| 7. Leverage .dockerignore | |
| 8. use correct base image | |
| 9. Standard pypi wheels don't work on Alpine | |
| 10. consider multi-stage build |
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
| Flows . | |
| Centralized . | |
| . Workflow uses a central repository to serve as the single point-of-entry for all changes to the project. The default development branch is called {main} and all changes are committed into this branch. Doesn’t require any other branches besides main. | |
| . Has no defined pull request of forking patterns. | |
| . Suited for teams migrated from SVN and small teams. | |
| Pros . | |
| # simple | |
| Cons . | |
| # not suitable for large teams |
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
| """ | |
| During tests every outgoing email instead of being sent | |
| to outer world is saved in django.core.mail.outbox. | |
| """ | |
| from django.core import mail | |
| def test_send_mail(): | |
| mail.send_mail( | |
| 'Example subject', |
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 contextlib import contextmanager | |
| import time | |
| @contextmanager | |
| def timeit(): | |
| start = time.monotonic() | |
| yield | |
| print(time.monotonic() - start) | |
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
| def make_closure(x): | |
| def closure(): | |
| nonlocal x | |
| print(x) | |
| x *= 2 | |
| print(x) | |
| return closure | |
| make_closure(2)() |
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
| .doc application/msword | |
| .dot application/msword | |
| .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document | |
| .dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template | |
| .docm application/vnd.ms-word.document.macroEnabled.12 | |
| .dotm application/vnd.ms-word.template.macroEnabled.12 | |
| .xls application/vnd.ms-excel | |
| .xlt application/vnd.ms-excel |
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
| <li><a href="{% url 'url_name' param1 param2 %}">{{ question.question_text }}</a></li> |
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
| ## @namespace officegenerator.demo | |
| ## @brief Generate ODF example files | |
| import argparse | |
| import datetime | |
| import gettext | |
| import os | |
| import pkg_resources | |
| from decimal import Decimal | |
| from officegenerator.commons import __version__ |
NewerOlder