Skip to content

Instantly share code, notes, and snippets.

View aubricus's full-sized avatar

Aubrey Taylor aubricus

View GitHub Profile
aubricus /
Last active January 29, 2019 00:10 — forked from excenter/rune.bash
Mojave pyenv update
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
aubricus / put-inside-functions.php
Created November 20, 2018 02:41 — forked from gilzow/put-inside-functions.php
Removes user endpoints from WordPress REST API
View put-inside-functions.php
* Remove API Endpoints
* Clobber API routes to remove them from public access.
function remove_wp_json_api_endpoints($endpoints) {
$toRemove = array(
aubricus / example.html
Created December 7, 2017 04:14
FocusPoint JS Using Picture Element
View example.html
<div class="focuspoint"
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="">
<source media="(min-width: 992px)" srcset="">
aubricus /
Last active October 15, 2017 10:19
De-Dupe / Return Draft DjangoCMS Plugin Instances
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if == "my_plugin_fk":
kwargs["queryset"] = models.MyPluginModel.objects.filter(
Q(placeholder__static_draft__isnull=False) |
return super().formfield_for_foreignkey(db_field, request, **kwargs)
aubricus / example.scss
Last active June 23, 2017 00:45
Hook a fixed position element into the DjangoCMS toolbar expanded / collapsed states
View example.scss
// 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;
aubricus / .gitconfig
Last active September 5, 2017 23:54
Some helpful .gitconfig aliases for following a commit format
View .gitconfig
# Commit with scope / message shortcuts
# Remember to quote $2 if it contains spaces
# Usage:
# git <alias> <scope> "<Commit Message>"
# Example:
# git chore docs "Update"
chore = "!f() { git commit -m \"chore($1): $2\"; }; f"
fix = "!f() { git commit -m \"fix($1): $2\"; }; f"
aubricus /
Last active November 11, 2017 11:32
django_extensions reset_db is incompatible with any .py file that accesses the database that's loaded during a `./` system checks cycle. This gist simply overrides the default `reset_db` command to disable these checks.
from 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)
aubricus / cors.json
Created April 23, 2017 22:17
Example Heroku compatible S3 CORS.json config
View cors.json
"CORSRules": [
"AllowedOrigins": ["*"],
"AllowedHeaders": ["Authorization"],
"AllowedMethods": ["GET"],
"MaxAgeSeconds": 3000
"""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__)
# See:
class NoValue(object):
def __repr__(self):
return '<{0}>'.format(self.__class__.__name__)
NOTSET = NoValue()