Skip to content

Instantly share code, notes, and snippets.

View elidickinson's full-sized avatar

Eli Dickinson elidickinson

View GitHub Profile
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.1
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
@elidickinson
elidickinson / _gradients.css.scss
Created November 21, 2012 17:52 — forked from thbar/_gradients.css.scss
SCSS mixing for CSS3 gradients
@mixin gradient($from, $to) {
background-color: $from; /* fallback/image non-cover color */
background-image: -moz-linear-gradient($from, $to); /* Firefox 3.6+ */
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to)); /* Safari 4+, Chrome 1+ */
background-image: -webkit-linear-gradient($from, $to); /* Safari 5.1+, Chrome 10+ */
background-image: -o-linear-gradient($from, $to); /* Opera 11.10+ */
// extras from http://www.colorzilla.com/gradient-editor/
background: -ms-linear-gradient(top, $from 0%,$to 100%); /* IE10+ */
background: linear-gradient(to bottom, $from 0%,$to 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$from', endColorstr='$to',GradientType=0 ); /* IE6-9 */
@elidickinson
elidickinson / real_ip_address.py
Created November 29, 2012 03:33
ProxiedRequest class for flask that gets correct remote_addr
from flask import Request
class ProxiedRequest(Request):
"""
`Request` subclass that overrides `remote_addr` with Frontend Server's
HTTP_X_FORWARDED_FOR when available.
"""
@property
def remote_addr(self):
@elidickinson
elidickinson / utmstrip.js
Last active May 24, 2016 08:29 — forked from paulirish/utmstrip.user.js
Strips visible utm_ strings off URLs on your site, but makes sure Google Analytics tracks them first
// utmstrip.js strips utm_* strings from the URL bar of your site, but afer Google Analytics
// has had a chance to grab them. Based on Paul Irish's utm-stripping user script.
//
// Source: https://gist.github.com/elidickinson/9128677
//
// Install Notes:
// - This script should run *after* you have added all your "_trackPageview" or "_trackEvent"
// calls to the _gaq variable.
// - It doesn't matter of Google Analtyics has actually finished loading yet, but if you
// you tell it to strip the utm_* strings before _trackPageview sees them, it won't know