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 | |
/** | |
* Remove any non-ASCII characters and convert known non-ASCII characters | |
* to their ASCII equivalents, if possible. | |
* | |
* @param string $string | |
* @return string $string | |
* @author Jay Williams <myd3.com> | |
* @license MIT License | |
* @link http://gist.github.com/119517 |
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 | |
/** | |
* Parse a string, and convert it into a series of sequential numbers. | |
* It works similar to Acrobat's print specified pages input box. | |
* | |
* Examples: | |
* | |
* input: "1, 2, 3, 4, 5, 6" --> output: 1, 2, 3, 4, 5, 6 | |
* input: "1-6" --> output: 1, 2, 3, 4, 5, 6 |
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 | |
/** | |
* @package shippingMethod | |
* @copyright Copyright 2003-2006 Zen Cart Development Team | |
* @copyright Portions Copyright 2003 osCommerce | |
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 | |
* @version $Id: perweightunit.php 3308 2006-03-29 08:21:33Z ajeh $ | |
*/ | |
/** | |
* "Per Weight Unit" shipping module, allowing you to offer per-unit-rate shipping options |
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
diff a/includes/modules/shipping/perweightunit.php b/includes/modules/shipping/perweightunit.php | |
94c94 | |
< global $order, $shipping_weight; | |
--- | |
> global $order, $shipping_weight, $shipping_num_boxes; | |
101,102c101,102 | |
< 'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units) | |
< + MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING))); | |
--- | |
> 'cost' => ((MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units) |
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
-- Get Wordpress posts that are within a specific date range | |
-- Useful for an events calednar. | |
SELECT wp_posts.ID, wp_posts.post_title, wp_posts.post_name, start.meta_value AS start_date, end.meta_value AS end_date | |
FROM wp_postmeta AS `end` | |
JOIN wp_postmeta AS `start` ON ( end.post_id = start.post_id ) | |
JOIN wp_posts ON ( end.post_id = wp_posts.ID ) | |
WHERE ( | |
end.meta_key = "End Date" | |
AND end.meta_value >= DATE_FORMAT( NOW() , "%Y/%m/%d") | |
) |
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 | |
/** | |
* Convert a multi-dimensional array into a stdClass object. | |
* | |
* Example: | |
* $values = array('hello'=>'world'); | |
* | |
* // Convert the array to an object | |
* array_to_object($values); | |
* |
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 | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return 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
# Installing PHP 7.4.33 as CGI/FastCGI on a Pair Networks VPS | |
# By Jay Williams <http://myd3.com/> | |
# Based off of the Pair Users wiki page "Installing PHP5 as cgi" <http://www.pairusers.com/?How%20to%20install%20PHP5> | |
# Note: Replace "USERNAME" with your actual server username | |
# Make src directory in home | |
mkdir ~/src | |
# Download, configure, and compile OpenSSL |
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
<html> | |
<head> | |
<title>IE Placeholder Text</title> | |
</head> | |
<body> | |
<input type="text" name="myInputField" value="" placeholder="HTML5 Placeholder Text" id="myInputField"> |
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 | |
/***************************************** | |
* Created this test for job interviews. * | |
*****************************************/ | |
/** | |
* Directions | |
* | |
* Read the direction in the Q and respond below A. |
OlderNewer