Skip to content

Instantly share code, notes, and snippets.

Michael Thessel MichaelThessel

Block or report user

Report or block MichaelThessel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MichaelThessel
MichaelThessel / assetMinify.php
Last active Aug 25, 2017
Simple Magento asset minifier
View assetMinify.php
<?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
AW Colorswatches performance optimization
View AWColorswatches.diff
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
AVR Makefile Template
View Makefile
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 Nov 17, 2015
SNS Avaz Producttabs performance fixes
View gist:f7caca1d84b3367da888
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()) {
View gist:68e0bb6df8a12cd4ff2c
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 Dec 18, 2014
Magento add PHP stack trace to SQL queries
View gist:f9de8f427155011cd7d9
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 {
You can’t perform that action at this time.