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 | |
function get_combinations($arrays) { | |
$result = array(array()); | |
foreach ($arrays as $property => $property_values) { | |
$tmp = array(); | |
foreach ($result as $result_item) { | |
foreach ($property_values as $property_value) { | |
$tmp[] = array_merge($result_item, array($property => $property_value)); | |
} |
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
/** SSL */ | |
define('FORCE_SSL_ADMIN', true); | |
// in some setups HTTP_X_FORWARDED_PROTO might contain | |
// a comma-separated list e.g. http,https | |
// so check for https existence | |
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) | |
$_SERVER['HTTPS']='on'; | |
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
CREATE OR REPLACE VIEW `cs_inventory_stock_1` AS select distinct `legacy_stock_status`.`product_id` AS `product_id`, `legacy_stock_status`.`website_id` AS `website_id`, `legacy_stock_status`.`stock_id` AS `stock_id`, `legacy_stock_status`.`qty` AS `quantity`, `legacy_stock_status`.`stock_status` AS `is_salable`, `product`.`sku` AS `sku` from ( `cs_cataloginventory_stock_status` as `legacy_stock_status` join `cs_catalog_product_entity` as `product` on (( `legacy_stock_status`.`product_id` = `product`.`entity_id` ))) |
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 printjsonerror(){ | |
switch (json_last_error()) { | |
case JSON_ERROR_NONE: | |
echo ' - No errors'; | |
break; | |
case JSON_ERROR_DEPTH: | |
echo ' - Maximum stack depth exceeded'; | |
break; |
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 links href from array JQuery | |
$(function() { | |
var links = $("#blogPagination ul a").map(function() { | |
return this.href; | |
}).get(); | |
console.log(links); | |
}); | |
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 | |
/** | |
* Add Continue Shopping Button on Cart Page | |
* Add to theme functions.php file or Code Snippets plugin | |
*/ | |
add_action( 'woocommerce_before_cart_table', 'woo_add_continue_shopping_button_to_cart' ); | |
function woo_add_continue_shopping_button_to_cart() { |
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
add_filter( 'wp_nav_menu_items', 'add_loginout_link', 1, 2 ); | |
function add_loginout_link( $items, $args ) { | |
if (is_user_logged_in() && $args->theme_location == 'main-menu') { | |
$current_user = wp_get_current_user(); | |
$items .= '<li><a href="'. wp_logout_url( '') .'">Log Out</a></li>'; | |
// $items .= '<li><a style="color: #777777!important; "class="logged_in_user" href="#">Hi, '.$current_user->user_login .'</a></li>'; |
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
Error Number: 1054 | |
Unknown column 'aafdas' in 'field list' | |
SELECT v.vendorTitle, b.vendorBranchName,b.vendorLongitude,b.vendorLatitude,b.vendorWebsite,b.vendorBrief,b.vendorLogoURL,b.vendorTelephone1,b.vendorHoursOfOpration, round(( 6371 * acos( cos( radians( aafdas ) ) * cos( radians( b.vendorLatitude ) ) * cos( radians( b.vendorLongitude ) - radians(19.14513599999998 ) ) + sin( radians( aafdas ) ) * sin( radians( b.vendorLatitude ) ) ) )) AS distance FROM vendor as v JOIN vendor_branch as b ON v.vendorID=b.vendorBranchOf HAVING distance <= 50 ORDER BY distance | |
Filename: models/Location_model.php | |
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
touch -t 201808291217.14 test.txt |
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
<IfModule mod_headers.c> | |
SetEnvIf Host genr8online.com MAGE_RUN_CODE=genr8_co | |
SetEnvIf Host genr8online.com MAGE_RUN_TYPE=website | |
SetEnvIf Host bslim.co.uk MAGE_RUN_CODE=bslim_co | |
SetEnvIf Host bslim.co.uk MAGE_RUN_TYPE=website | |
SetEnvIf Host bactiv.co.uk MAGE_RUN_CODE=base | |
SetEnvIf Host bactiv.co.uk MAGE_RUN_TYPE=website | |
</IfModule> |
NewerOlder