Skip to content

Instantly share code, notes, and snippets.

View aubricus's full-sized avatar
Coffee.

Aubrey Taylor aubricus

Coffee.
View GitHub Profile
cd /usr/local
sudo chown -R `whoami`:admin ./
git reset --hard
git clean -fd
cd ~
brew update
@aubricus
aubricus / loader-gist.py
Created September 9, 2013 07:01
Python plugin loader.
def load_plugin(target, invoke_on_load=True, invoke_args=(),
invoke_kwargs={}):
if ':' in target:
module_name, attr_name = target.rsplit(':', 1)
else:
module_name, attr_name = target.rsplit('.', 1)
try:
module = import_module(module_name)
@aubricus
aubricus / swipe.js
Last active December 23, 2015 11:49
Swipe Detection
SwipeEvent = {
'START' : 'start',
'DRAG' : 'drag',
'COMPLETE': 'complete',
'FAIL' : 'fail'
};
/**
* @namespace Swipe
* @description Simple interface to detect a touch based "Swipe"
@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
;;
@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 / setup_snippet.py
Created February 24, 2014 08:48
Use pandoc to convert README.md into .rst for Pypi
long_description = ''
try:
import subprocess
import pandoc
process = subprocess.Popen(
['which pandoc'],
shell=True,
stdout=subprocess.PIPE,
@aubricus
aubricus / gist:9902952
Created March 31, 2014 21:38
Pbcopy Python
p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE)
p.stdin.write('copy-text')
p.stdin.close()
@aubricus
aubricus / 01_common.js
Last active January 11, 2018 09:37
Load Greensock TweenLite and TimelineLite with Require.js
require.config({
baseUrl: '/js',
/* non-essential config removed for berevity */
packages: [
/* gsap package looks like:
vendor/
gsap/
non-amd/
@aubricus
aubricus / .bash_profile
Created May 30, 2014 01:52
virtualenvwrapper config
export WORKON_HOME=$HOME/.virtualenv
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_REQUIRE_VIRTUALENV=true
export PIP_RESPECT_VIRTUALENV=true
# If virtualenv wrapper exists in these locations...
venvwrappers[0]="/usr/local/share/python/virtualenvwrapper.sh"
venvwrappers[1]="$HOME/.virtualenv/default/bin/virtualenvwrapper.sh"
<body>
<!-- code removed for brevity -->
<!-- require setup, do not delete -->
<script src="{{STATIC_URL}}/js/vendor/require.js"></script>
<script>
require(['{{STATIC_URL}}/js/common.js'], function(){
require(['main']);
});