Skip to content

Instantly share code, notes, and snippets.

View tomfuertes's full-sized avatar

Tom Fuertes tomfuertes

View GitHub Profile
@tomfuertes
tomfuertes / notes.md
Last active August 28, 2015 16:53 — forked from mona87/notes.md
clearhead hw

##V1 Sticky-Reminder

###The Struggle Originally I started off using jQuery.noConflict() in my code in:

jQuery.noConflict();
(function( $ ) {
  $(function() {
    //my code
 });
@tomfuertes
tomfuertes / google-tag-manager.js
Last active August 29, 2015 14:03
Google Tag Manager & Optimizely
/* _optimizely_evaluate=force */ /*jshint curly:false*/
/**
* Curries "{experiment name}: {variation name}" to GTM
* via window.clearhead['ab{n}']
*/
var experimentId = 'TODO'; // experiment id
var chDimension = 'TODO'; // 1,2,3,4,5
// poll till optimizely's global exists
var timeout = setInterval(function () {
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
bar[foo?'doSomething':'doSomethingElse'](el);
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
@tomfuertes
tomfuertes / complex.js
Created August 29, 2014 16:37
Clearhead.me's pattern for polling in Monetate
/**
* Polling for variables in Monetate
*/
(function () {
var pollFor = {
'#foo': function (selector) {
$(selector).text('new foo');
},
'#bar': function (selector) {
$(selector).replaceWith('<button id="new-bar">New Bar</button>');
// Instructions: Take 3x passes w/ notes each time
// #.1: no console / no stackoverflow
// #.2: use console / no stackoverflow
// #.3: use console / use stackoverflow
// end result should look like:
// 1) How could you rewrite \n`{abc(xyz)}`?
// 1.1) I'd remove xyz like \n`abc()`
// 1.2) Confirmed works in console but needed to run it \n`abc()`
// 1.3) Googled and found this different approach I'd like more \n`if (!xyz) abc()}` (link to article / answer)
@tomfuertes
tomfuertes / jshintable-html.js
Last active August 29, 2015 14:19
jshintable gtm code pattern
<script>!0;// jshint ignore:line
(function () {
'use strict';
window.foo = 'bar';
})();
// </script>
@tomfuertes
tomfuertes / polling.js
Last active August 29, 2015 14:20
performant conditional polling example
function(activate, options) {
(function poll() {
if ( $('#logged-in').length ) {
activate();
} else if ( ! $.isReady ) {
setTimeout(poll, 25);
}
})();
}

Experimental Generation of Interpersonal Closeness

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should

@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>