Skip to content

Instantly share code, notes, and snippets.

View aubricus's full-sized avatar
Coffee.

Aubrey Taylor aubricus

Coffee.
View GitHub Profile
@aubricus
aubricus / .gitconfig
Last active September 5, 2017 23:54
Some helpful .gitconfig aliases for following a commit format
# 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"
@aubricus
aubricus / example.scss
Last active June 23, 2017 00:45
Hook a fixed position element into the DjangoCMS toolbar expanded / collapsed states
// 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
aubricus / cors.json
Created April 23, 2017 22:17
Example Heroku compatible S3 CORS.json config
{
"CORSRules": [
{
"AllowedOrigins": ["*.herokuapp.com"],
"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: 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()
@aubricus
aubricus / private_pypi_howto.md
Last active November 29, 2016 03:00 — forked from Jaza/Private-pypi-howto
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
@aubricus
aubricus / brew-upgrade-all.sh
Created October 25, 2016 03:42
Brew Upgrade All
brew upgrade $(brew outdated | grep '^[a-zA-Z]')
@aubricus
aubricus / view.js
Last active May 2, 2016 20:18
Micro-visual-state-transition mechanic
define(function (require, exports, module) {
var _ = require("underscore");
var $ = require("jquery");
var backbone = require("backbone");
var marionette = require("marionette");
var UploadImagesModalView = marionette.LayoutView.extend({
validTansitionStates: ["initial", "activity", "valid", "invalid"],
@aubricus
aubricus / subtree.md
Last active December 24, 2015 12:29
Subtree commands.

Fetch the Code:

Vendor (run 1st):

git subtree add --prefix src/bigview/static/js/vendor git@github.com:blitzagency/agency-ui-deps.git master --squash

AUF (run 2nd):

git subtree add --prefix src/bigview/static/js/vendor/auf git@github.com:blitzagency/agency-ui-foundation.git master --squash

Update the Code if Needed:

@aubricus
aubricus / run-jasmine-chrome.sh
Created October 2, 2013 17:57
Run Jasmine in Chrome with correct permissions.
#! /bin/bash
read -r -p "This will restart Chrome, is that ok? [Y/n] " response
case $response in
[yY][eE][sS]|[yY])
killall Google\ Chrome
sleep 1s
open -a Google\ Chrome --args --allow-file-access-from-files
;;