Skip to content

Instantly share code, notes, and snippets.

View RamananSharma's full-sized avatar
🎯
Focusing

Ramanan Sharma RamananSharma

🎯
Focusing
View GitHub Profile
@RamananSharma
RamananSharma / sample.com.conf
Last active March 2, 2016 16:25
HTTPS Configuration
<VirtualHost *:80>
ServerName sample.com
Redirect permanent / https://sample.com/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin admin@localhost
ServerName sample.com
ServerAlias www.sample.com
@RamananSharma
RamananSharma / utm_tracking
Created December 15, 2015 03:49 — forked from SoreThumb/utm_tracking
Fork of https://gist.github.com/devinsays/6831221 ; Yes, Devin basically wrote a few lines that I had to expand into 50. :) See some example uses in the content below. This fork allows you to use the current URL to change links on the page-- includes auto-replacement of existing UTM variables.
(function($) {
$.fn.utm_tracking = function(domain, source, medium, campaign) {
$(this).find('a[href^="' + domain + '"]').each(function() {
var url = $(this).attr('href');
$(this).attr( 'href', url + '?utm_source=' + source + '&utm_medium=' + medium + '&utm_campaign=' + campaign );
});
}
$.fn.utm_tracking_via_obj = function(domain, utmObj) {
utmObj = utmObj || $.utm_data_from_url();
$(this).find('a[href^="' + domain + '"]').each(function() {