Skip to content

Instantly share code, notes, and snippets.

View adjohu's full-sized avatar
🎶
Writing code

Adam Hutchinson adjohu

🎶
Writing code
View GitHub Profile
$(window).bind('beforeunload', function(){
return Editor.beforeClose();
});
/*
var keyHandler = function(){
_.each( arguments, function(
}
keyHandler('ctrl','leftarrow',function(){
$ = jQuery
pluginName = "propertyBinding"
$.propertyBinding = (element, options) ->
self = @
defaults =
a : 1
b : 2
$(function(){
(function() {
var fixSliderPosition = function() {
var slider = $("#qContent");
if (!slider.length) {
setTimeout(doStuff, 200);
return;
}
slider.show();
$(function(){
(function() {
var isMobile = function() {
return navigator.userAgent.search(/iphone|ipod|ipad|android/i) > -1;
};
var fixSliderPosition = function() {
var slider = $("#qContent");
if (!slider.length) {
setTimeout(fixSliderPosition, 200);
$(function(){
(function() {
var iphone = false;
var supportsFixed = function () {
var ua = navigator.userAgent;
if (/iphone|ipod|ipad/i.test(ua)) {
iphone = true;
return !(/OS [1-4]/i.test(ua));
(test = {
_html: function (arr) {
return $(arr.join(""));
},
_urlMatch: function (regex, callback) {
if (regex.test(window.location.href)) {
return callback();
}
},
@adjohu
adjohu / gist:2827899
Created May 29, 2012 11:18
expired links
(function () {
var env, test, $;
/*
* Set up environment
*/
(env = {
init: function () {
$ = env.getJquery();
@adjohu
adjohu / Gallery Collection
Created June 27, 2012 20:47
Base Collection
window._qbetc = [
{
clientId: "lowcostholidays",
domain: ".lowcostholidays.com",
experiments: [
{
id: "T004-property-results",
creatives: {
"creative1": {
activation: function () {},
//var formContainer = $("#ctl00_ContentPlaceHolder1_ffnpPayBrasPag1_dvBPCC");
var findPrev = function (node, needle) {
var found = false;
do {
node = node.previousSibling;
var nv = node.nodeValue;
if (nv && nv.indexOf(needle) > -1) {
found = true;
}
} while (!found);