Skip to content

Instantly share code, notes, and snippets.

View buiquangduc's full-sized avatar
🎯
Focusing

Bui Quang Duc buiquangduc

🎯
Focusing
View GitHub Profile
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
mysql -Nse 'show tables' DATABASE_NAME -uDB_USER -pDB_PASSWORD | while read table; do mysql -e "drop table $table" DATABASE_NAME -uDB_USER -pDB_PASSWORD ; done
error_reporting(0);
ini_set('display_errors', 0);
git archive --output=file.zip HEAD $(git diff --name-only commit-first commit-last)
<?php
$command = new BashCommand();
$command->run();
?>
<?php
$command = (new BashCommand())->run();
?>
<?php
define('DB_NAME', '<your database name>');
define('DB_USER', '<your database usename');
define('DB_PASSWORD', '<your database password>');
?>
/**
* Add academy contact name custom field in frontend
*
* @return void
*/
function add_contact_name() {
$key = '_wcv_custom_settings_contact_name';
$value = \get_user_meta( get_current_user_id(), $key, true );
// Bank Name
\WCVendors_Pro_Form_Helper::input( [
\add_filter( 'woocommerce_save_account_details_required_fields', [$this, 'add_required_fields'], 10, 3 );
function add_required_fields($fields) {
$fields['billing_phone'] = __( 'Phone Number', 'woocommerce' );
$fields['salon'] = __( 'Salon', 'woocommerce' );
return $fields;
}
@buiquangduc
buiquangduc / gist:695ca7822f2cd743b98944a263f88622
Created September 3, 2017 16:11
Create archive file save all the files changed between two commit
git archive --output=file.zip HEAD $(git diff --name-only SHA1 SHA2)