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> |
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
<?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
/** | |
* @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
/** | |
* 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
/** | |
* 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
;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
function colourFade (start, end, steps) { | |
var steps = steps || 10; | |
var start = start ? start.replace('#', '') : '000000' | |
var end = end ? end.replace('#', '') : 'FFFFFF' | |
var out = {"r":[],"g":[],"b":[]}; | |
var floor = Math.abs; | |
console.log(start,end,end.substr(2,4)); |
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
#!/bin/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ]; then |
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
Gol = class() | |
function Gol:init(W, H) | |
-- Set the size | |
self.columns = W | |
self.rows = H | |
-- The varying states of cells | |
self._alive = 1 | |
self._dead = 0 |
OlderNewer