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
<?php | |
// Takes two dates formatted as YYYY-MM-DD and creates an | |
// inclusive array of the dates between the from and to dates. | |
// Taken from: http://stackoverflow.com/a/4312491 | |
function createDateRangeArray($sDate, $eDate) | |
{ | |
$range = array(); |
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 Distance = { | |
rad: function (x) { | |
return x * Math.PI / 180; | |
}, | |
haversine: function (p1, p2) { | |
var R = 637100000, | |
dLat = this.rad(p2.latitude - p1.latitude), | |
dLong = this.rad(p2.longitude - p1.longitude), |
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
// Taken from: http://stackoverflow.com/a/476681 | |
(function() { | |
var arrayOfImages = ["one.jpg", "two.jpg", "three.jpg"]; | |
function preload(arrayOfImages) { | |
$(arrayOfImages).each(function () { | |
$('<img/>')[0].src = this; | |
}); | |
} |
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
// Taken from: http://stackoverflow.com/a/9349999 | |
// <img data-other-src="big-zebra.jpg" src="small-zebra.jpg"> | |
// <img data-other-src="big-elephant.jpg" src="small-elephant.jpg"> | |
// <img data-other-src="big-bear.jpg" src="small-bear.jpg"> | |
$(function () { | |
$('img').on('mouseenter mouseleave', function () { | |
$(this).attr({ | |
src: $(this).attr('data-other-src'), |
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
// parseUri 1.2.2 | |
// (c) Steven Levithan <stevenlevithan.com> | |
// MIT License | |
function parseUri (str) { | |
var o = parseUri.options, | |
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), | |
uri = {}, | |
i = 14; |
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
// parseURL function from James padolsey | |
// http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ | |
function parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
source: url, | |
protocol: a.protocol.replace(':',''), | |
host: a.hostname, |
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
// Douglas Crockford typeOf function | |
function typeOf(value) { | |
var s = typeof value; | |
if (s === 'object') { | |
if (value) { | |
if (value instanceof Array) { | |
s = 'array'; | |
} | |
} else { |
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
[ { | |
"year": "2016", | |
"semester": "summer 2", | |
"start": "2016-06-23", | |
"end": "2016-07-29" | |
}, | |
{ | |
"year": "2016", | |
"semester": "summer 1", | |
"start": "2016-05-16", |
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
{"eventType":"didRangeBeaconsInRegion","beacons":[{"major":65215,"minor":38409,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-70,"proximity":"ProximityNear"},{"major":50499,"minor":1311,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-73,"proximity":"ProximityNear"},{"major":28680,"minor":57614,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-86,"proximity":"ProximityNear"},{"major":65523,"minor":5129,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-78,"proximity":"ProximityNear"},{"major":161,"minor":7854,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-74,"proximity":"ProximityNear"},{"major":16258,"minor":63095,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-80,"proximity":"ProximityFar"}],"region":{"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","identifier":"banana","typeName":"BeaconRegion"}} |