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 / gist:8056f4ef04d9f70025fe
Last active August 29, 2015 14:01
Stored procedure - truncate all tables [MySQL]
DELIMITER //
CREATE PROCEDURE truncateAllTables()
--
-- truncateAllTables
-- Date: 2014-05-26
-- Author: Andrew Cassidy <andrew@cassidywebservices.co.uk>
-- Author: Marko Martinović <marko@techytalk.info>
--
-- This Stored Procedure loops over the tables in the current database and
-- truncates them.
@Marko-M
Marko-M / quick-chat.php
Created July 18, 2014 18:12
Display Quick Chat programmatically
<php
if(class_exists('Quick_Chat')) {
global $quick_chat;
*/
* Define option variables:
*
* $height = '400';
* $room = 'default';
@Marko-M
Marko-M / phpmyadmin-localhost-autologin.php
Last active August 29, 2015 14:04
PhpMyAdmin@localhost autologin
<?php
/**
* No activity within 1440 seconds; please log in again >>no more<<
*
* /etc/phpmyadmin/config.inc.php or wherever your PhpMyAdmin config file is
*
*/
$cfg['Servers'][$i]['auth_type']= 'config';
$cfg['Servers'][$i]['user'] = 'whatever';
@Marko-M
Marko-M / Processor.php
Last active August 29, 2015 14:07
Magento Enterprise edition block_html cache ban bugfix
<?php
class Whatever_Whatever_Model_Pagecache_Processor extends Enterprise_PageCache_Model_Processor
{
/**
* Do additional validation for request to be cached. Add condition that request must
* have request subprocessor implemented in order to be considered cacheable.
* Deals with bug found by @tim_bezhashvyly.
*
@Marko-M
Marko-M / config.php
Created November 29, 2014 17:54
Magento 2 Alpha 106 app/etc/config.php
<?php
return array (
'backend' =>
array (
'frontName' => 'backend',
),
'db' =>
array (
'table_prefix' => '',
'connection' =>
@Marko-M
Marko-M / ubuntu_install_compass.sh
Created December 17, 2014 14:46
Ubuntu install foundation, compass and sass
# Verified: Ubuntu 14.10
sudo apt-get install ruby ruby-dev
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs
sudo npm install -g bower grunt-cli
@Marko-M
Marko-M / varnish-3.x-ubuntu-14.10.sh
Last active August 29, 2015 14:12
Varnish 3.x for Ubuntu 14.10
#!/bin/bash
# Varnish 3.x for Ubuntu 14.10
# Add repository
sudo add-apt-repository ppa:marko-techytalk.info/varnish-3.0
# Update sources
sudo apt-get update
# Install Varnish 3.x
@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