1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv to manually rebuild the font cache
| import re | |
| from re import Pattern | |
| from typing import Dict, Any, cast | |
| from pydantic.utils import update_not_none | |
| from pydantic.validators import constr_length_validator | |
| class RFC3986Regex: | |
| ALPHA: Pattern = r"[a-zA-Z]" |
| from django.conf import settings | |
| def SessionCookieSameSiteWorkaround(get_response): | |
| def middleware(request): | |
| # See: | |
| # https://blog.chromium.org/2019/10/developers-get-ready-for-new.html | |
| # https://github.com/django/django/pull/11894 | |
| # https://web.dev/samesite-cookie-recipes/#handling-incompatible-clients | |
| # https://www.chromium.org/updates/same-site/incompatible-clients |
| """ | |
| A unittest.TestCase mixin that allows using the | |
| responses (https://pypi.python.org/pypi/responses/) package in tests. | |
| Usage | |
| ----- | |
| Install responses with `pip install responses`. | |
| Add `ResponsesMixin` to your `TestCase` parent classes instead of using |
| # Orignal version taken from http://www.djangosnippets.org/snippets/186/ | |
| # Original author: udfalkso | |
| # Modified by: Shwagroo Team and Gun.io | |
| # Further modified by: Jakub Skalecki (https://rock-it.pl) | |
| import hotshot | |
| import hotshot.stats | |
| import textwrap | |
| import os |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv to manually rebuild the font cache
| # AWS S3 bucket for static hosting | |
| resource "aws_s3_bucket" "website" { | |
| bucket = "${var.website_bucket_name}" | |
| acl = "public-read" | |
| tags { | |
| Name = "Website" | |
| Environment = "production" | |
| } |
We want to make sure to add a new remote as normal:
git remote add <remote name> <url for git repo>
Now we can setup multiple origin push urls:
git remote set-url --add --push origin <git url one>git remote set-url --add --push origin <git url two>| from django.views.generic import TemplateView | |
| if settings.DEBUG: | |
| # enable local preview of error pages | |
| urlpatterns += patterns('', | |
| (r'^403/$', TemplateView.as_view(template_name="403.html")), | |
| (r'^404/$', TemplateView.as_view(template_name="404.html")), | |
| (r'^500/$', TemplateView.as_view(template_name="500.html")), |
| <toolSet name="Code Checking"> | |
| <tool name="Flake8" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true"> | |
| <exec> | |
| <option name="COMMAND" value="/usr/local/bin/flake8" /> | |
| <option name="PARAMETERS" value="--max-complexity 10 $FilePath$" /> | |
| <option name="WORKING_DIRECTORY" value="$ProjectFileDir$" /> | |
| </exec> | |
| <filter> | |
| <option name="NAME" value="Filter 1" /> | |
| <option name="DESCRIPTION" /> |