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
Setup a new filter in Google Analytics with the following configuration: | |
Filter Type: Custom Filter | |
Filter Field: User Defined | |
Filter Pattern: no_report | |
Case sensitive No |
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
{# asdf #} | |
{# {{ var }} {% if %} ... {% endif %} #} | |
{{ asdf }} | |
<script type="text/javascript"> | |
fruits = new Array('apples', 'oranges', 'bananas'); | |
for (var i=0; i < fruits.length; i++) { | |
alert(fruits[i]); |
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
// requires jQuery | |
// insert after _gaq is declared but before you talk to Google | |
// track all clicks on links as events | |
$('a').click(function(e) { | |
var debug = false; // if set to true will log instead of calling google | |
if (this.hostname && this.hostname !== location.hostname) { | |
var eCat = 'External Link'; | |
} else { |
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
# Useful if dev settings are pointed at the production or staging database on a remote host | |
# In the dev settings, after the `DATABASES` configuration, add a second wrapped in an `if` statement | |
import sys | |
if 'test' in sys.argv: | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', |
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
# Configure colors, if available. | |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
c_reset='\[\e[0m\]' | |
c_user='\[\e[0;32m\]' | |
c_path='\[\e[1;34m\]' | |
c_git_clean='\[\e[0;37m\]' | |
c_git_staged='\[\e[0;32m\]' | |
c_git_unstaged='\[\e[0;31m\]' | |
else | |
c_reset= |
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
{% ifequal request.get_host '127.0.0.1:8000' %} | |
{# Include something only to be executed on "localhost" here. #} | |
{% else %} | |
{# Include something only to be executed in production here. #} | |
{% endifequal %} |
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
function getDirection(f, b) { | |
var h = f.width(), | |
d = f.height(), | |
a = (b.x - f.offset().left - h / 2) * (h > d ? d / h : 1), | |
c = (b.y - f.offset().top - d / 2) * (d > h ? h / d : 1), | |
g = Math.round((Math.atan2(c, a) * (180 / Math.PI) + 180) / 90 + 3) % 4; | |
switch (g) { | |
case 0: | |
return "top"; | |
case 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise64" | |
# The url from where the 'config.vm.box' box will be fetched if it |
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
#!/bin/sh | |
if [ $(git diff HEAD@{1} HEAD --name-only | grep 'requirements/development.txt' -c) -ne 0 ] | |
then | |
sudo $VIRTUAL_ENV/bin/pip install -r /vagrant/myproject/requirements/development.txt | |
fi | |
compass compile /vagrant/myproject/myproject/static_media/stylesheets -e production --force | |
$VIRTUAL_ENV/bin/python /vagrant/myproject/manage.py syncdb |
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
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD | |
* Build: http://modernizr.com/download/#-shiv-cssclasses-load | |
*/ | |
;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g) |