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 getDistanceBetweenLatLongs (start, end) { | |
// Starting lat, long | |
var lat1 = start.lat.toRad(); | |
var lng1 = start.lng.toRad(); | |
// Destination lat, long | |
var lat2 = end.lat.toRad(); | |
var lng2 = end.lng.toRad(); | |
// Earths radius in km |
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
/** | |
* Util function for lightening the colour with a % | |
* @param - string - colour with leading # | |
* @param - number - percentage to lighten by | |
*/ | |
function lighten (c,p) { | |
var n = parseInt(c.slice(1),16) | |
, a = Math.round(2.55 * p) | |
// Bitshift 16 bits to the left | |
, r = (n >> 16) + a |
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
/** | |
* Prototype for recursively iterating over an array of | |
* arrays. | |
* @author Dave Mackintosh | |
* @param callback function | |
*/ | |
Array.prototype.recursiveArrayIterator = function (cb) { | |
this.forEach(function (obj, inx) { | |
// If it's an array we want to fire another iterator | |
// with our parent array as a separate argument |
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
/** | |
* @param slides ~ Array (ARRAY) of image locations | |
* @param duration ~ Number - in milliseconds how long to run for | |
* @param element ~ jQuery object - The <img> tag to change the src of. | |
* @returns void | |
* | |
* @example | |
* <img src="#" id="sequence" data-loop="true" data-autoplay="true" /> | |
* <script>var vid = new PNGSequence(tiffanyCrystal, 4, $('#sequence'));</script> | |
*/ |
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 | |
//Popular products function | |
function popular_products ($atts) { | |
//Expose the Db to the function | |
global $wpdb; | |
//Get the results | |
$pp = $wpdb->get_results("SELECT `prodid`, SUM(quantity) | |
FROM `{$wpdb->prefix}wpsc_cart_contents` |
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
<div id="MyArticles"> | |
<section></section> | |
<section></section> | |
</div> |
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
<style> | |
section { | |
width:80%; | |
float:left; | |
} | |
article { | |
width:20%; | |
float:right; | |
} | |
</style> |
NewerOlder