Skip to content

Instantly share code, notes, and snippets.

View Marko-M's full-sized avatar

Marko Martinović Marko-M

View GitHub Profile
@Marko-M
Marko-M / magemeter-run-benchmark.sh
Last active August 29, 2015 14:26
MageMeter Run Benchmark Bash Script
#!/bin/bash
# Author: Marko Martinović
# http://www.magemeter.com/about
# Prints command traces
set -x
# Path to Apache jMeter executable
JMETER_PATH="/path/to/apache/jmeter/bin"
@Marko-M
Marko-M / magento-php-7.0.patch
Last active August 29, 2015 14:28
PHP 7.0 beta 3 Magento 1.x patch
diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php
index f5dc619..373736d 100644
--- a/app/code/core/Mage/Core/Model/Layout.php
+++ b/app/code/core/Mage/Core/Model/Layout.php
@@ -552,7 +552,7 @@ class Mage_Core_Model_Layout extends Varien_Simplexml_Config
$out = '';
if (!empty($this->_output)) {
foreach ($this->_output as $callback) {
- $out .= $this->getBlock($callback[0])->$callback[1]();
+ $out .= $this->getBlock($callback[0])->{$callback[1]}();
@Marko-M
Marko-M / system.log
Created October 30, 2015 11:10
SUPEE-6788 system.log
2015-10-30T10:54:10+00:00 DEBUG (7): SELECT `main_table`.* FROM `permission_variable` AS `main_table` WHERE (`variable_name` = 'web/unsecure/base_url') AND (`is_allowed` = 1)
2015-10-30T10:54:11+00:00 DEBUG (7): SELECT `main_table`.* FROM `permission_variable` AS `main_table` WHERE (`variable_name` = 'web/unsecure/base_url') AND (`is_allowed` = 1)
2015-10-30T10:54:11+00:00 DEBUG (7): SELECT `main_table`.* FROM `permission_variable` AS `main_table` WHERE (`variable_name` = 'web/unsecure/base_url') AND (`is_allowed` = 1)
2015-10-30T10:54:11+00:00 DEBUG (7): SELECT `main_table`.* FROM `permission_variable` AS `main_table` WHERE (`variable_name` = 'web/unsecure/base_url') AND (`is_allowed` = 1)
2015-10-30T10:54:11+00:00 DEBUG (7): SELECT `main_table`.* FROM `permission_variable` AS `main_table` WHERE (`variable_name` = 'web/unsecure/base_url') AND (`is_allowed` = 1)
2015-10-30T10:54:11+00:00 DEBUG (7): SELECT `main_table`.* FROM `permission_variable` AS `main_table` WHERE (`variable_name` = 'web/unsecure/base_url
@Marko-M
Marko-M / resave.php
Last active October 25, 2019 12:29
Script to re-save Magento store products per store/product type
<?php
require_once 'abstract.php';
class Mmartinovic_Shell_Resave extends Mage_Shell_Abstract
{
protected $_stores = [];
protected $_types = [];
public function __construct() {
parent::__construct();
@Marko-M
Marko-M / soap-debug.php
Created November 23, 2015 08:07
Debug SOAP requests
<?php
/**
* Debug SOAP requests
*/
$client = new SoapClient(
'http://example.loc/index.php/api/v2_soap/?wsdl'
);
// Set yourself debug session cookie, for Xdebug and Phpstorm
@Marko-M
Marko-M / gist:e8a7367b8c8699af0346
Last active December 10, 2015 14:16
Redis/Magento 1.x - Current Full Page Cache size in bytes
redis-cli -p 6379
127.0.0.1:6380> SELECT 0
OK
127.0.0.1:6380> KEYS *CAHCE*
1) "zc:k:446_FPC_CACHE_SIZE_CAHCE_KEY"
127.0.0.1:6380> HGET zc:k:446_FPC_CACHE_SIZE_CAHCE_KEY d
"3439338"
@Marko-M
Marko-M / product_attribute_installer.php
Created January 21, 2016 09:03 — forked from antoinekociuba/product_attribute_installer.php
Magento Product Attribute installer script.
<?php
/**
* Product Attribute Installer
*/
try {
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
@Marko-M
Marko-M / magento-template-check.sh
Last active February 19, 2016 08:32
Magento Template Check
#!/bin/bash
grep -Ein "get(Singleton|(Resource)?Model)" $(find -name "*.phtml")
@Marko-M
Marko-M / fpc-block-html-optimize.patch
Last active March 25, 2016 13:44
Magento improvement targeting FPC/block_html compatibility causing one cache storage access per layout block issue
--- app/code/core/Mage/Core/Block/Abstract.php 2016-03-25 14:22:51.934883000 +0100
+++ app/code/local/Mage/Core/Block/Abstract.php 2016-03-25 14:39:53.806883000 +0100
@@ -1,4 +1,17 @@
<?php
+/*
+ * Prevent unnecessary requests to cache storage on
+ *
+ * core_block_abstract_to_html_after
+ *
+ * due to
@Marko-M
Marko-M / gist:f9517c7acfcdff75e976d82fb750dbe3
Last active June 11, 2016 11:24
Vagrant 1.8.3 with Ubuntu 16.04 LTS
#!/bin/bash
# Marko Martinović
# https://devgenii.com/
#
# Workaround for issue where Vagrant fails to install plugins due to RubyGems > v2.3.0 and Bundler Gem v1.12.0:
#
# ... `block in sort_dependencies': undefined method `payload' for nil:NilClass (NoMethodError)
#
# For example Vagrant 1.8.3 installed from .deb package @ HashiCorp website on Ubuntu 16.04 LTS.