This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mySitch(situation){ | |
var holla = 'I got the rolly on my arm and I\'m pouring Chandon.'; | |
if(mySitch.LOOKUP.hasOwnProperty(situation)){ | |
holla = [mySitch.LOOKUP[situation], mySitch.SUFFIX].join(' '); | |
} | |
alert(holla); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.MAP = function(func){ | |
var data = {}, definition = {}, defaults = {}; | |
MAP.each(MAP._grab_, function(def){ | |
var value = def.getter(); | |
if(value) data[def.key] = value; | |
}); | |
definition = MAP.find(MAP._map_, function(def){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Store a copy of the original jQuery#removeClass method | |
var _originalMethod = $.prototype.removeClass; | |
// Replace the jQuery#removeClass method with our own | |
// custom function | |
$.prototype.removeClass = function(){ | |
// Convert the arguments object into an array | |
var args = Array.prototype.slice.call(arguments); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var factory = document.createElement('div'); | |
var html = '<table class="bootstrapper" style="margin:auto;width:500px;position:absolute;top:10px;left:10px;background:#fff;border-spacing:10px;border-collapse:separate;font-size:14px;font-family:Arial">'; | |
var opts = Bootstrapper.ensightenOptions; | |
for(key in opts){ | |
html += '<tr>'; | |
html += '<td style="text-align:right">' + key + '</td>'; | |
html += '<td>' + opts[key] + '</td>'; | |
html += '</tr>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ajaxSuccess(function(evt, res, req){ | |
// here's where we look for our signature | |
if('/apps/mytmobile/eservice/servlet/UserProfile' != req.url) return; | |
if(!/UPDATE_NAME/.test(req.data)) return; | |
// extract ['key=value'] pairs | |
var params = {}, data; | |
data = req.data; | |
data = decodeURIComponent(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ajaxSuccess(function(evt, res, req){ | |
console.log(arguments); | |
var url = req.url || ''; | |
var response = res.responseText || ''; | |
var operation; | |
operation = /operation=(.+?)\&/i.exec(req.data); | |
operation = operation ? operation[1] : ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = s_gi(s_mpcs_account); | |
// set defaults here | |
function S(){ | |
if(!(this instanceof S)) return new S(); | |
} | |
S.prototype = s; | |
// your code below |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var results = document.getElementById('browse_result_area'); | |
results.style.display = 'none'; | |
function debounce(func, delay){ | |
var timer; | |
return function(){ | |
clearTimeout(timer); | |
timer = setTimeout(func, delay); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contacts = []; | |
function add( firstName, lastName, phone, email ){ | |
contacts[ contacts.length ] = { | |
firstName : firstName, | |
lastName : lastName, | |
phone : phone, | |
email : email | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toArray(arr, start){ return Array.prototype.slice.call(arr, start || 0) } | |
Function.prototype.curry = function(){ | |
var __method = this, args = toArray(arguments); | |
return function(){ | |
return __method.apply(this, args.concat(toArray(arguments))); | |
} | |
} | |
Function.prototype.autoCurry = function(numArgs){ |