Skip to content

Instantly share code, notes, and snippets.

Avatar

Marko Martinović Marko-M

View GitHub Profile
@Marko-M
Marko-M / gist:8056f4ef04d9f70025fe
Last active Aug 29, 2015
Stored procedure - truncate all tables [MySQL]
View gist:8056f4ef04d9f70025fe
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 Jul 18, 2014
Display Quick Chat programmatically
View quick-chat.php
<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 Aug 29, 2015
PhpMyAdmin@localhost autologin
View phpmyadmin-localhost-autologin.php
<?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 Aug 29, 2015
Magento Enterprise edition block_html cache ban bugfix
View Processor.php
<?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 Nov 29, 2014
Magento 2 Alpha 106 app/etc/config.php
View config.php
<?php
return array (
'backend' =>
array (
'frontName' => 'backend',
),
'db' =>
array (
'table_prefix' => '',
'connection' =>
@Marko-M
Marko-M / ubuntu_install_compass.sh
Created Dec 17, 2014
Ubuntu install foundation, compass and sass
View ubuntu_install_compass.sh
# 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 Aug 29, 2015
Varnish 3.x for Ubuntu 14.10
View varnish-3.x-ubuntu-14.10.sh
#!/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 Aug 29, 2015
MageMeter Run Benchmark Bash Script
View magemeter-run-benchmark.sh
#!/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 Aug 29, 2015
PHP 7.0 beta 3 Magento 1.x patch
View magento-php-7.0.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 Oct 30, 2015
SUPEE-6788 system.log
View 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