Skip to content

Instantly share code, notes, and snippets.

View tomfuertes's full-sized avatar

Tom Fuertes tomfuertes

View GitHub Profile
@tomfuertes
tomfuertes / Calendar.html
Created July 25, 2012 18:24
AnalyticsDataLayer Updates | Calendar
<!-- Starting on line line 764 of /haoi/611.1009820.1291204/calendar/year.html -->
<div id="analyticsData" data-analytics-appEnvironment="stage" data-analytics-brand="HolidayRentals"
data-analytics-viewName="&#x2f;calendar&#x2f;year" data-analytics-detailTypeSingular=""
data-analytics-userID="7977cf4c858c46f4b84edcb3fa204d56" data-analytics-propID=""
data-analytics-listingID="" data-analytics-reservationID="" data-analytics-calendarID=""
data-analytics-isNewReservation="" data-analytics-listingAction="" data-analytics-UMS-GUID=""
data-analytics-purchaseID="" data-analytics-productName="" data-analytics-productQuantity=""
data-analytics-productPrice="" data-analytics-inquiryId="" data-analytics-pageType=""
data-analytics-pageName="" data-analytics-visitorType="owner" data-analytics-testing=""
data-analytics-ppc="">&nbsp;</div>
@tomfuertes
tomfuertes / basetag.js
Created August 1, 2012 15:42
Base Tag Restructuring Pending jQuery Load
(function (window, document, undefined) {
// Load a script and fire callback
function loadScript(url, callback) {
var cdn = document.createElement('script');
cdn.type = 'text/javascript';
cdn.async = true;
cdn.src = url;
cdn.onload = function () {
if (!cdn.onloadDone) {
@tomfuertes
tomfuertes / base.js
Created August 2, 2012 14:06
Base Tag Restructuring Pending Bootstrapper.bindDomParsed
(function () {
var cdn = document.createElement('script');
cdn.type = 'text/javascript';
cdn.async = true;
cdn.src = '//sub.domain.com/shared/bootstrap/0.8.0.2/js/libs/gas-utils.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(cdn, s);
})();
(function () {
webPropertyId = [];
@tomfuertes
tomfuertes / new.js
Created August 15, 2012 19:46
Ensighten Helper Update
//Helper Functions
(function(window, document, undefined) {
window.gaGetParameterByName = function(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
};
window.gaGetElementsByClassName = function(e) {
var tags = this.all || this.getElementsByTagName('*');
tfuertes at ha001921 in ~
$ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install uwsgi
==> Downloading http://projects.unbit.it/downloads/uwsgi-1.2.5.tar.gz
Already downloaded: /Library/Caches/Homebrew/uwsgi-1.2.5.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/uwsgi-1.2.5.tar.gz
==> python uwsgiconfig.py --build
python uwsgiconfig.py --build
using profile: buildconf/default.ini
detected include path: ['/usr/local/include', '/usr/include/libxml2', '/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/', '/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include', '/usr/include', '/System/Library/Frameworks', '/Library/Frameworks']
configured CFLAGS: -O2 -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -arch x86_64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_BUILD_DATE="\"04 September 2012 08:52:26\"" -DUWSGI_HAS_IFADDRS -mmacosx-version-min=10.5 -DUWSGI_LOCK_USE_OSX_SPINLOCK -DUWSGI_EVENT_USE_KQUEUE -DUWS
@tomfuertes
tomfuertes / inline.html
Created October 18, 2012 14:18
Example Google Conversion Code (Javascript)
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1234567890;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "666666";
var google_conversion_label = "Purchase";
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
// 1: how could you rewrite the following to make it shorter?
foo ? bar.doSomething(el) : bar.doSomethingElse(el);
// 2: what is the faulty logic in the following code?
var foo = 'hello';
(function() {
var foo = window.foo || 'world';
@tomfuertes
tomfuertes / _setSiteSpeedSampleRate.js
Last active December 21, 2015 03:39
Use this snippet to get the max out of your site speed samples
/**
* GOAL: Get the maximum allowed RUM data pushed into GA each day
* Use this formula if you're < 1,000,000 Pageviews / Day
* If you're > 1,000,000, disregard this whole thing as the GA auto samples at your capped 1%
* About Page Speed: https://support.google.com/analytics/answer/1205784?hl=en
* About _setSiteSpeedSampleRate: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._setSiteSpeedSampleRate
*/
var AVERAGE_DAILY_PAGEVIEWS = 100000; // Replace with your Average Daily Pageviews from Google Analytics
@tomfuertes
tomfuertes / datalayer.html
Last active December 21, 2015 09:19
Senior Advisor DataLayer
<html>
<head>
<title>Foo Bar</title>
<!-- DATALAYER GOES HERE - JUST BEFORE </head> -->
<script>var datalayer = {foo:"bar"};</script>
</head>
</html>
@tomfuertes
tomfuertes / gas.core.js
Created October 18, 2013 16:13
GAS w/ dc.js
/**
* @preserve Copyright 2011, Cardinal Path and DigitalInc.
*
* GAS - Google Analytics on Steroids
* https://github.com/CardinalPath/gas
*
* @author Eduardo Cereto <eduardocereto@gmail.com>
* Licensed under the GPLv3 license.
*/
(function(window, undefined) {