Skip to content

Instantly share code, notes, and snippets.

View MichaelThessel's full-sized avatar

Michael Thessel MichaelThessel

View GitHub Profile
@MichaelThessel
MichaelThessel / issue-19469.diff
Created May 1, 2020 21:01
Patch for Magento issue #19469 (for installations utilizing vendor for core Magento modules)
diff --git a/vendor/magento/module-customer/Model/Customer.php b/vendor/magento/module-customer/Model/Customer.php
index 2692d1edf014..1e4914b152de 100644
--- a/vendor/magento/module-customer/Model/Customer.php
+++ b/vendor/magento/module-customer/Model/Customer.php
@@ -21,6 +21,7 @@
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Math\Random;
+use Magento\Framework\Indexer\IndexerInterface;
@MichaelThessel
MichaelThessel / assetMinify.php
Last active August 25, 2017 20:54
Simple Magento asset minifier
<?php
require_once 'abstract.php';
/**
* Minifies Magento JS and CSS file
*/
class Ac_Asset_Minify extends Mage_Shell_Abstract
{
// https://github.com/yui/yuicompressor/releases
@MichaelThessel
MichaelThessel / AWColorswatches.diff
Last active May 25, 2016 01:39
AW Colorswatches performance optimization
diff --git a/app/code/local/AW/Colorswatches/Helper/Swatch.php b/app/code/local/AW/Colorswatches/Helper/Swatch.php
index 8a2a868..09807fb 100644
--- a/app/code/local/AW/Colorswatches/Helper/Swatch.php
+++ b/app/code/local/AW/Colorswatches/Helper/Swatch.php
@@ -87,16 +87,22 @@ class AW_Colorswatches_Helper_Swatch
$collection = $swatchAttribute->getSwatchCollection();
$childProducts = $this->_getAssociatedProductList($product);
+
+ $childCodes = array();
@MichaelThessel
MichaelThessel / Makefile
Created May 4, 2016 07:17
AVR Makefile Template
BIN=main
OBJS=main.o
SRCS=main.c
MCU=atmega328p
SPEED=16000000UL
LIBS=-L usbdrv
CC=avr-gcc
OBJCOPY=avr-objcopy
@MichaelThessel
MichaelThessel / gist:f7caca1d84b3367da888
Created November 17, 2015 01:03
SNS Avaz Producttabs performance fixes
diff --git a/app/code/local/Sns/Producttabs/Block/Grid.php b/app/code/local/Sns/Producttabs/Block/Grid.php
index 2bee3dd..cc43c3b 100644
--- a/app/code/local/Sns/Producttabs/Block/Grid.php
+++ b/app/code/local/Sns/Producttabs/Block/Grid.php
@@ -1,15 +1,32 @@
<?php
-class Sns_Producttabs_Block_Grid extends Sns_Producttabs_Block_List{
- protected function _toHtml(){
+class Sns_Producttabs_Block_Grid extends Sns_Producttabs_Block_List {
+ public function __construct($attributes = array()) {
This file has been truncated, but you can view the full file.
# Time: 151111 17:01:55
# User@Host: ac[ac] @ localhost []
# Query_time: 22.269255 Lock_time: 0.092547 Rows_sent: 431 Rows_examined: 2626706
SET timestamp=1447297315;
/*/src/ac/lib/Zend/Db/Statement/Pdo.php 57
/src/ac/app/code/core/Zend/Db/Statement.php 115
/src/ac/lib/Zend/Db/Adapter/Pdo/Abstract.php 184
/src/ac/lib/Zend/Db/Adapter/Abstract.php 479
/src/ac/lib/Zend/Db/Adapter/Pdo/Abstract.php 238
@MichaelThessel
MichaelThessel / gist:f9de8f427155011cd7d9
Created December 18, 2014 20:50
Magento add PHP stack trace to SQL queries
diff --git a/lib/Zend/Db/Statement/Pdo.php b/lib/Zend/Db/Statement/Pdo.php
index 4530897..3561d05 100644
--- a/lib/Zend/Db/Statement/Pdo.php
+++ b/lib/Zend/Db/Statement/Pdo.php
@@ -54,6 +54,7 @@ class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggrega
*/
protected function _prepare($sql)
{
+ $sql = $this->_trace() . $sql;
try {