I hereby claim:
- I am samuelcole on github.
- I am samuelcole (https://keybase.io/samuelcole) on keybase.
- I have a public key whose fingerprint is 1DA1 E259 A6E3 C70B 190E C7DB 8949 FB93 61B3 7BF1
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
-----BEGIN PGP SIGNED MESSAGE----- | |
Hash: SHA512 | |
i can't believe you aren't on this thing | |
-----BEGIN PGP SIGNATURE----- | |
Version: Keybase OpenPGP v1.0.3 | |
Comment: https://keybase.io/crypto | |
wsBcBAABCgAGBQJUGjSoAAoJEISvsyhSVj73HngIAI9x2C7BQ3ElRCV9EVoH4l6Z | |
ixeIrD+PHxgIpbjmUYNhYamd5stueMaV+EQw6yvRVOw3fBfdNXPBBmFUNpo06zwH |
Verifying that +samuelcole is my openname (Bitcoin username). https://onename.io/samuelcole |
# given a set of shows that the user is going to | |
going = [c, e] | |
# and a set of shows that are available | |
available = [a, b, c, d] | |
# 1. insert the going shows at the beginning of the array | |
# 2. make sure the same show doesn't appear twice | |
list == [c, e, a, b, d] |
window.requires_urls = {}; | |
(function($){ | |
$.requires = function(url, callback) { | |
// look for the url in our cached url results | |
for(called_url in window.requires_urls) { | |
var cached = window.requires_urls[called_url].cached; | |
// if a url matches and it has cached results | |
if(url_equals(url, called_url) && cached.data) { |
// zero dependency $.getScript for loading external javascript (like jQuery.js | |
// or other big libraries) in a way that does not block the normal page load | |
// (http://www.yuiblog.com/blog/2008/07/22/non-blocking-scripts/). | |
// | |
// heavily influenced by/copied from jQuery's ajax functions (http://jquery.com) | |
window.$ = { | |
getScript: function(script_src, callback) { | |
var done = false; | |
var head = document.getElementsByTagName("head")[0] || document.documentElement; |
window.match_protocol = function(url) { | |
var RE_PROTO = /^\w+:\/\//; | |
if(RE_PROTO.test(url)) { | |
var protocol = window.location.protocol; | |
url = url.replace(RE_PROTO, protocol + "//"); | |
} | |
return url; | |
}; |
// Checks if a DOM object is valid. | |
// Expects an array of functions in data('validations') that return true when | |
// valid. | |
// | |
// Triggers field_invalid or field_valid. | |
// Calls options.invalid() or options.valid(). | |
$.fn.validate = function(options) { | |
var $this = $(this); | |
/* $this.data('validations') is an array of functions, each of which |
/* | |
Storage Polyfill by Remy Sharp. | |
Delinted by Samuel Cole. | |
*/ | |
if (typeof window.localStorage === 'undefined' || typeof window.sessionStorage === 'undefined') { | |
(function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { |
(function ($) { | |
function background_image_url($object) { | |
var string = $object.css('backgroundImage'), | |
url_regex = /[("]([^()"]+)[")]/; | |
return url_regex.exec(string)[1]; | |
} | |
$.fn.preload_background_image = function () { | |
return $(this).each(function () { | |
(new Image()).src = background_image_url($(this)); |