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 / 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 / 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 / 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 / gist:10931ff5e990431b5410
Last active August 14, 2018 02:51
Stored procedure - drop all tables [MySQL]
DELIMITER //
CREATE PROCEDURE dropAllTables()
--
-- dropAllTables
-- Date: 2014-05-26
-- Author: Andrew Cassidy <[email protected]>
-- Author: Marko Martinović <[email protected]>
--
-- This Stored Procedure loops over the tables in the current database and
-- drops them.
@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 <[email protected]>
-- Author: Marko Martinović <[email protected]>
--
-- This Stored Procedure loops over the tables in the current database and
-- truncates them.
@Marko-M
Marko-M / gist:9588211
Last active September 12, 2018 10:06
Xdebug trace with ?XDEBUG_TRACE trigger
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.auto_trace=0
xdebug.trace_enable_trigger=1
xdebug.trace_format=0
xdebug.trace_output_name=trace.%R
xdebug.collect_params=1
#!/bin/bash
# magento-transfer-2.sh
# Marko Martinovic
#
# Initiate on a destination web server
# Maintenance mode required
# Prints command traces
set -x
#!/bin/bash
# magento-transfer-1.sh
# Marko Martinovic
#
# Initiate on a new web server
# Maintenance mode not required
# Prints command traces
set -x
@Marko-M
Marko-M / magento-dump-import-ssh.sh
Last active November 22, 2017 14:00
Almost one-liner dump and import of Magento database trough SSH (with ignore tables and triggers definer adjustment)
#!/bin/bash
# Marko Martinović
# Prints command traces
set -x
# Tables to ignore
IGNORE_TABLES=(dataflow_batch_export dataflow_batch_import log_customer log_quote log_summary log_summary_type log_url log_url_info log_visitor log_visitor_info log_visitor_online report_event index_event enterprise_logging_event_changes core_cache core_cache_tag core_session core_cache_tag)
# Source SSH
@Marko-M
Marko-M / git_amend_change_author.sh
Created September 7, 2013 20:19
Git - Amend previous commit to change author
#!/bin/bash
git commit --amend --author="You <[email protected]>"