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 bitly_shorten($url) { | |
$login = "bitly_login"; | |
$apikey = "bitly_apikey"; | |
$format = "json"; | |
$query = array("login" => $login, | |
"apiKey" => $apikey, | |
"longUrl" => urlencode($url), | |
"format" => $format); |
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 | |
define('DS', DIRECTORY_SEPARATOR); | |
function _getExtractSchemaStatement($sqlFileName, $db) | |
{ | |
$dumpSchema = 'mysqldump' . ' '; | |
$dumpSchema .= '--no-data' . ' '; | |
$dumpSchema .= '-u ' . $db['user'] . ' '; | |
$dumpSchema .= '-p' . $db['pass'] . ' '; | |
$dumpSchema .= '-h ' . $db['host'] . ' '; |
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: WooCommerce Installments Example | |
* Plugin URI: http://claudiosmweb.com/ | |
* Description: Added the price with 3 installments without interest. | |
* Author: claudiosanches | |
* Author URI: http://www.claudiosmweb.com/ | |
* Version: 1.0 | |
* License: GPLv2 or later | |
*/ |
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
# With Sudo | |
sudo find . -type d -exec chmod 755 {} \; | |
sudo find . -type f -exec chmod 644 {} \; | |
sudo chmod 777 -R app/etc/; | |
sudo chmod 777 -R var/; | |
sudo chmod 777 -R media/; | |
# Without Sudo |
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 wc_ninja_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} | |
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 ); |
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 | |
/** | |
* Hide the "In stock" message on product page. | |
* | |
* @param string $html | |
* @param string $text | |
* @param WC_Product $product | |
* @return string | |
*/ | |
function my_wc_hide_in_stock_message( $html, $text, $product ) { |
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
########################################################## | |
# PRODUCTS | |
########################################################## | |
DELETE FROM `catalog_product_bundle_option`; | |
DELETE FROM `catalog_product_bundle_option_value`; | |
DELETE FROM `catalog_product_bundle_selection`; | |
DELETE FROM `catalog_product_entity_datetime`; | |
DELETE FROM `catalog_product_entity_decimal`; | |
DELETE FROM `catalog_product_entity_gallery`; | |
DELETE FROM `catalog_product_entity_int`; |
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 | |
$input = 'nome:ps4 sku:SKU7889-988;OI99129 data:10/12/2016 nome:Playstation 4 nome:Nintendo Wii sku:TESTE123 9aos'; | |
preg_match_all('/(?:([^: ]+):)([^: ]+(?:\s+[^: ]+\b(?!:))*)/', $input, $matches, PREG_SET_ORDER); | |
echo $input; | |
echo '<pre>'; | |
print_r($matches); | |
echo '</pre>'; |
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 | |
namespace Sitewards\SyncURLs\Console\Command; | |
use \Symfony\Component\Console\Command\Command; | |
use \Symfony\Component\Console\Input\InputInterface; | |
use \Symfony\Component\Console\Output\OutputInterface; | |
use \Magento\Framework\App\Config\ConfigResource\ConfigInterface; | |
use \Magento\Store\Model\StoreManagerInterface; |
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 | |
class Magento1ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
OlderNewer