This file contains 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
export LDFLAGS="-L/usr/local/opt/sqlite/lib -L/usr/local/opt/zlib/lib" | |
export CPPFLAGS="-I/usr/local/opt/sqlite/include -I/usr/local/opt/zlib/include" | |
xcode-select --install | |
brew update | |
brew upgrade | |
brew install zlib | |
pyenv install 3.7.1 | |
pyenv global 3.7.1 |
This file contains 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
<?php | |
/** | |
* Remove API Endpoints | |
* | |
* Clobber API routes to remove them from public access. | |
*/ | |
function remove_wp_json_api_endpoints($endpoints) { | |
$toRemove = array( | |
"/oembed/1.0/embed", | |
"/wp/v2/users", |
This file contains 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
<div class="focuspoint" | |
role="presentation" | |
data-focus-x-sm="-0.27" data-focus-y-sm="0.98" data-image-w-sm="992" data-image-h-sm="685" | |
data-focus-x-md="-0.29" data-focus-y-md="1.00" data-image-w-md="1102" data-image-h-md="809" | |
data-focus-x-lg="-0.05" data-focus-y-lg="1.00" data-image-w-lg="1600" data-image-h-lg="879" | |
> | |
<picture class="img-presentation"> | |
<source media="(min-width: 1200px)" srcset="http://cdn.com/path/to/marquee-lg.jpg"> | |
<source media="(min-width: 992px)" srcset="http://cdn.com/path/to/marquee-md.jpg"> |
This file contains 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 formfield_for_foreignkey(self, db_field, request, **kwargs): | |
if db_field.name == "my_plugin_fk": | |
kwargs["queryset"] = models.MyPluginModel.objects.filter( | |
Q(placeholder__static_draft__isnull=False) | | |
Q(placeholder__page__publisher_is_draft=True) | |
) | |
return super().formfield_for_foreignkey(db_field, request, **kwargs) |
This file contains 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
// Hook a fixed position element into the DjangoCMS toolbar expanded / collapsed states | |
.fixed-element { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100% | |
.cms-toolbar-expanding &, | |
.cms-toolbar-expanded & { | |
top: 46px; |
This file contains 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
# Commit with scope / message shortcuts | |
# Remember to quote $2 if it contains spaces | |
# | |
# Usage: | |
# git <alias> <scope> "<Commit Message>" | |
# | |
# Example: | |
# git chore docs "Update README.md" | |
chore = "!f() { git commit -m \"chore($1): $2\"; }; f" | |
fix = "!f() { git commit -m \"fix($1): $2\"; }; f" |
This file contains 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_extensions.management.commands.reset_db import Command as ResetDBCommand | |
class Command(ResetDBCommand): | |
requires_system_checks = False | |
help = "Override django-extensions reset_db and disable system_checks." | |
def handle(self, *args, **options): | |
self.stdout.write("Executing customized version of reset_db that disables system checks.") | |
super().handle(*args, **options) |
This file contains 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
{ | |
"CORSRules": [ | |
{ | |
"AllowedOrigins": ["*.herokuapp.com"], | |
"AllowedHeaders": ["Authorization"], | |
"AllowedMethods": ["GET"], | |
"MaxAgeSeconds": 3000 | |
} | |
] | |
} |
This file contains 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
"""Collect settings for this app from django settings.""" | |
from django.core.exceptions import ImproperlyConfigured | |
class NotSetButRequired(object): | |
def __repr__(self): | |
return '<{0}>'.format(self.__class__.__name__) |
This file contains 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
# See: https://github.com/joke2k/django-environ/blob/v0.4.1/environ/environ.py#L48 | |
class NoValue(object): | |
def __repr__(self): | |
return '<{0}>'.format(self.__class__.__name__) | |
# https://github.com/joke2k/django-environ/blob/v0.4.1/environ/environ.py#L67 | |
NOTSET = NoValue() |
NewerOlder