Skip to content

Instantly share code, notes, and snippets.

View erikhansen's full-sized avatar

Erik Hansen erikhansen

View GitHub Profile
[xdebug]
xdebug.profiler_enable_trigger=on
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.idekey=ECLIPSE_XDEBUG
xdebug.collect_vars=on
xdebug.collect_params=4
@erikhansen
erikhansen / magento1_enterprise_index_diagnostics.sql
Created February 18, 2016 14:46 — forked from mttjohnson/magento1_enterprise_index_diagnostics.sql
Magento 1.x Enterprise Partial Indexing Diagnostics Toolset
-- When products are added/removed from a category this table stores all the relation data
select * from catalog_category_product where product_id = '218';
-- The index that is used for presenting products in a category on the frontend
select * from catalog_category_product_index where product_id = '218';
-- The change log table used for Magento EE partial index functionality
select * from catalog_category_product_index_cl where product_id = '218';
-- The cron job that gets executed on each cron execution - check for errors
@erikhansen
erikhansen / web56_env.php
Last active November 15, 2016 16:20
dev-web56 Gist - The purpose of this Gist is to provide a template Magento 2 env.php file to use within the davidalger/devenv environment. See usage instructions below: https://gist.github.com/erikhansen/cfa278a80a6684bb7aa8d79ebcbf2f63#gistcomment-1922462
<?php
return array (
'backend' =>
array (
'frontName' => 'backend',
),
'crypt' =>
array (
'key' => '<KEY>',
),
@erikhansen
erikhansen / braintree_settlement.sh
Created November 29, 2016 23:29 — forked from mttjohnson/braintree_settlement.sh
Braintree manual transaction settlement
# Setup local directory with braintree example and libraries
git clone git@github.com: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
@erikhansen
erikhansen / _responsive.less
Last active August 18, 2017 03:55
Magento 2 Responsive Media Queries
// /**
// * Copyright © 2015 Magento. All rights reserved.
// * See COPYING.txt for license details.
// */
//
// Responsive
// _____________________________________________
//
@erikhansen
erikhansen / readme.md
Last active September 11, 2017 19:14 — forked from GianlucaGuarini/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency.

How to create a global git commit hook by Matt Venables

1 Enable git templates (This tells git to copy everything in ~/.git-templates to your per-project .git/ directory when you run git init):

git config --global init.templatedir '~/.git-templates'

2 Create a directory to hold the global hooks:

mkdir -p ~/.git-templates/hooks

@erikhansen
erikhansen / show-detailed-error-when-duplicate-url-key.patch
Created June 9, 2017 17:53
Patch to see what is causing the "URL key for specified store already exists" error when saving entities in Magento 2. This patch should only be temporarily applied and needs to be applied to the vendor/magento/module-url-rewrite directory.
From 3523dd79d949f93e31fc675b190f17baf66f36c3 Mon Sep 17 00:00:00 2001
From: Erik Hansen <erikpallhansen@gmail.com>
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(-)
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;
@erikhansen
erikhansen / web70_env.php
Last active December 28, 2017 22:38
dev-web70 Gist - The purpose of this Gist is to provide a template Magento 2 env.php file to use within the davidalger/devenv environment. See usage instructions below: https://gist.github.com/erikhansen/94db292fe3650d5991dc#gistcomment-1700442
<?php
return array (
'backend' =>
array (
'frontName' => 'backend',
),
'crypt' =>
array (
'key' => '<KEY>',
),
@erikhansen
erikhansen / 1_find_crons_that_ran_more_than_once.sql
Last active May 16, 2018 16:53
Magento 2 - Find CRON jobs that ran more than once at a given second
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;