This file contains hidden or 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
# List the composer home directory | |
# Typically /Users/<user>/.composer or /home/<user>/.composer or C:\Users\<user>\AppData\Roaming\Composer | |
echo $COMPOSER_HOME | |
# List files in the composer home | |
ls -la $COMPOSER_HOME | |
# View auth.json in composer home used when no local ./auth.json exists in the directory executed from | |
cat $COMPOSER_HOME/auth.json |
This file contains hidden or 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
/* find the largest tables on the server */ | |
SELECT CONCAT(table_schema, '.', table_name) 'db.table', | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length + index_length DESC | |
LIMIT 10; |
This file contains hidden or 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
find . -printf '%TY-%Tm-%Td %TH\n' | sort | uniq -c |
This file contains hidden or 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
SET SESSION group_concat_max_len = 1000000; | |
SELECT job_code, count(job_code) AS how_many_times_did_job_run_more_than_once, SUM(count) AS total_number_of_times_job_ran, GROUP_CONCAT(executed_at_group) AS executed_at FROM ( | |
SELECT cron_schedule.*, GROUP_CONCAT(cron_schedule.executed_at) AS executed_at_group, count(job_code) AS count FROM cron_schedule WHERE executed_at IS NOT NULL GROUP BY job_code, executed_at HAVING count(job_code) > 1 ORDER BY executed_at DESC | |
) AS duplicate_crons | |
GROUP BY job_code | |
ORDER BY count(job_code) DESC; |
This file contains hidden or 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
Index: Model/SalesRule/Calculator.php | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- Model/SalesRule/Calculator.php (date 1513354238000) | |
+++ Model/SalesRule/Calculator.php (date 1513354238000) | |
@@ -45,6 +45,17 @@ | |
break; | |
This file contains hidden or 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
From 3523dd79d949f93e31fc675b190f17baf66f36c3 Mon Sep 17 00:00:00 2001 | |
From: Erik Hansen <[email protected]> | |
Date: Wed, 1 Feb 2017 13:20:02 -0600 | |
Subject: [PATCH] Edit the 'URL key for specified store already exists' message | |
--- | |
Model/Storage/AbstractStorage.php | 5 ++++- | |
Model/Storage/DbStorage.php | 5 ++++- | |
2 files changed, 8 insertions(+), 2 deletions(-) |
This file contains hidden or 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
/* | |
Run the following query to get a set of queries that will purge all tables of email addresses. The queries that are output from | |
this should be manually reviewed to remove queries for any unnecessary tables and can then be run manually or via a Magerun "db:query" | |
to include it as a part of a scripted cloning process. | |
IMPORTANT: Make sure to update the @db_name variable | |
What the resulting query will do: | |
-- Replace the emails in Magento with dummy emails (unless email is one of the whitelisted domains) in order to prevent emails erroneously being sent to customers. | |
-- Make all emails with @example.com and use and MD5 of the original domain of the email as the tag for the email. This is important in case we have two emails with the | |
-- same "local part" but different "domain part". For example, [email protected] would become [email protected] |
This file contains hidden or 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
/* | |
* IMPORTANT: The queries below are written for Magento Enterprise. If you're going to run them on Magento Community, you need | |
* to replace all instances of ".row_id" with ".entity_id". See this for context: http://magento.stackexchange.com/questions/139740/magento-2-schema-changes-for-ee-catalog-staging | |
* | |
* When importing products in Magento 2, if you specify store view codes in the store_view_code column, product data will be set at | |
* both the global scope as well as the specific store view scope. This is not ideal because now you have duplicate | |
* data at two different scopes that shouldn't actually be duplicated. The scripts below clean up this data by finding | |
* data set at specific store view scopes and if it's an exact match to the data set at the global store view, then it | |
* deletes the data set at the specific store view scope. | |
* |
This file contains hidden or 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
# Setup local directory with braintree example and libraries | |
git clone [email protected]:braintree/braintree_php_example.git | |
cd braintree_php_example | |
composer install | |
# Create and define configuration options | |
echo ' | |
BT_ENVIRONMENT=sandbox | |
BT_MERCHANT_ID=xxxxxxxxxxxx | |
BT_PUBLIC_KEY=xxxxxxxxxxxx |
This file contains hidden or 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 | |
return array ( | |
'backend' => | |
array ( | |
'frontName' => 'backend', | |
), | |
'crypt' => | |
array ( | |
'key' => '<KEY>', | |
), |