Skip to content

Instantly share code, notes, and snippets.

View svensson-david's full-sized avatar

David Svensson svensson-david

View GitHub Profile
@svensson-david
svensson-david / traffic-source 1.1.js
Last active July 11, 2016 10:22
Tweaked utm-alternative that adds each visit to the cookie. Automatically removes referrals from your own site. Skips addition if new hit is same as previous. Original here: https://github.com/dm-guy/utm-alternative
(function(cookieName, domain){
var traffic_source_COOKIE_TOKEN_SEPARATOR = ">>"; //separating between concatenated lead source
var traffic_source_meta_SEPARATOR = ">";
var traffic_source_date_SEPARATOR = "|";
var NONE = "(none)";
domain = domain || window.location.hostname;
function getCookie(cookieName){
@svensson-david
svensson-david / tictail-oauth2
Last active August 29, 2015 13:57
Oauth strategy for Tictail authentication
# Oauth strategy for Tictail authentication
# You will need additional code to handle the logins
# If using Devise follow this guide - https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class TictailOauth2 < OmniAuth::Strategies::OAuth2
# Give your strategy a name.