This file contains 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
/* | |
See JSFiddle for combined HTML/CSS/JS | |
http://jsfiddle.net/66c43ao1/ | |
*/ | |
$('.cover').each(function() { | |
var containerHeight = $(this).height(), | |
containerWidth = $(this).width(), | |
image = $(this).children('img'), | |
imageHeight = image.attr('height'), | |
imageWidth = image.attr('width'), |
This file contains 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 | |
header('Content-Type: text/plain'); | |
$file = 'path/to/file.kml'; | |
$array = (array) simplexml_load_file($file); | |
echo "Title\n"; | |
foreach ($array['Document']->Placemark as $pm) { |
This file contains 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
jQuery.extend({ | |
slugify: function(string) { | |
return $.trim(string) | |
.toLowerCase() | |
.replace(/[^\w ]+/g,'') | |
.replace(/ +/g,'-') | |
.replace(/\-{2,}/g,'-'); | |
} | |
}); |
This file contains 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
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function(obj, start) { | |
for (var i = (start || 0), j = this.length; i < j; i++) { | |
if (this[i] === obj) { return i; } | |
} | |
return -1; | |
} | |
} |
This file contains 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 getHashParam(name) { | |
var regex = new RegExp("(#)("+name+")(\=)([^#]*)"), | |
matches = []; | |
matches = regex.exec(window.location.hash); | |
if (matches !== null && matches.length > 4 && matches[4] !== null) { | |
return matches[4]; | |
} else { | |
return false; | |
} | |
} |
This file contains 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 runFunction(name, arguments) { | |
var fn = self[name]; | |
if (typeof fn !== 'function') { | |
return; | |
} | |
fn.apply(self, arguments); | |
} |