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 | |
/** | |
* Filter for GravityForms to group select field choices by a special "optgroup" choice. | |
* | |
* Simply add a new choice with a value of 'optgroup' to the dropdown to start a group of options. | |
* All following choices will be grouped under it using its label for the group. | |
* Any number of groups can be created, as each optgroup choice will start a new group. | |
* Supports field placeholder & ungrouped options, but must be before the first group. | |
* | |
* This snippet can be added to your theme's functions.php, or a custom plugin. |
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 | |
/** | |
* Plugin Name: Deny Giant Image Uploads | |
* Description: Prevents Uploads of images greater than 3.2MP | |
* Author: TJNowell | |
* Author URI: http://tomjn.com | |
* Plugin URI: http://tomjn.com/164/clients-who-upload-huge-camera-photos-decompression-bombs/ | |
* Version: 1.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
<?php | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
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
Hi | |
I hope this helps you all get started with phonegap and sqlite in your | |
application | |
Dean-O | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> |
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
/* Given table 'zipcodes' with columns: | |
zipcode, latitude, longitude. | |
Find zipcodes within radius from given zipcode. | |
EXAMPLE: | |
Coordinates for zip 91326 and radius 25 mi: | |
*/ | |
SET @location_lat = 34.2766, | |
@location_lon = -118.544; | |
SELECT zipcode, ( 3959 * acos( cos( radians(@location_lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(@location_lon) ) + sin( radians(@location_lat) ) * sin( radians( latitude ) ) ) ) AS distance |
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 | |
# Basic Usage | |
# requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string | |
# http://youurl.com/your-form-page/?gwunrequire=1 | |
new GWUnrequire(); | |
# Enable for All Users (Including Visitors) | |
# still requires the 'gwunrequire' parameter be added to the query string | |
new GWUnrequire( array( |
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
/** | |
* cache script and css to localStorage (same domain only) | |
* | |
* $CLS.style("a.css"); | |
* | |
* $CLS.script("jquery-1.5.2.min.js").wait() | |
* .script("a.js") | |
* .script("b.js") | |
* .script("c.js") | |
* .wait(function() { |
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
// knockout 2.2.1 | |
ko.utils.arrayFilter = function (array, predicate) { /* .. */ } | |
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ } | |
ko.utils.arrayForEach = function (array, action) { /* .. */ } | |
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ } |
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 | |
/** | |
* WooCommerce Extra Feature | |
* -------------------------- | |
* | |
* Add custom fee to cart automatically | |
* | |
*/ | |
function woo_add_cart_fee() { | |