Skip to content

Instantly share code, notes, and snippets.

View infabo's full-sized avatar
🏠
Working from home

Ingo Fabbri infabo

🏠
Working from home
View GitHub Profile
@vianetz
vianetz / Orderstatus.php
Last active December 30, 2015 03:19
Magento Observer to provide order status/state integrity
<?php
class Vianetz_StateStatusIntegrity_Model_Orderstatus extends Mage_Core_Model_Abstract
{
/**
* Event: sales_order_save_before
*
* @param Varien_Event_Observer $observer
*
* @return Vianetz_StateStatusIntegrity_Model_Orderstatus
@SchumacherFM
SchumacherFM / Stats.md
Last active October 9, 2018 05:47
Comparing different storage systems for Magento

Magento Caching Test

Testing three type of caches: persistent, non-persistent and two-level.

Prerequisites

  • MacBook Air
  • 13-inch, Mid 2012
  • Processor 1.8 GHz Intel Core i5
  • Memory 8 GB 1600 MHz DDR3
@parhamr
parhamr / opcache.ini
Last active March 14, 2016 23:15
Known working Zend OPcache configuration for PHP 5.5
; configuration for php ZendOpcache module
; Tuned for Magento 1.13.1 on PHP 5.5
; Test server has 8 CPU cores and 32 GB RAM
zend_extension=opcache.so
[opcache]
opcache.memory_consumption=256
opcache.interned_strings_buffer=12
opcache.max_accelerated_files=16000
opcache.enable_file_override=1
@kubaceg
kubaceg / databaseBackup.sh
Last active May 1, 2017 11:32
n98Magerun magento database backup script, creates daily, weekly and monthly dumps
#!/bin/bash
#CONFIG
backupDir='/mnt/backup'
magentoDir='/var/www/magento/htdocs'
magerunPath='/usr/bin/n98-magerun.phar'
#NUMBER OF DAYS TO KEEP BACKUPS
dailyKeepDays=7
weeklyKeepDays=30
@h3nn3s
h3nn3s / gist:d0c2015ff7fc4a7c438a
Created July 16, 2014 05:59
TYPO3 Gridelements with Flexform-Image
/*
* TypoScript
*/
# render headline
#tt_content.gridelements_pi1.10 = < lib.stdheader
tt_content.gridelements_pi1.20.10.setup {
1 < lib.gridelements.defaultGridSetup
1 {
columns {
1 < .default
@tegansnyder
tegansnyder / opcache.ini
Last active September 2, 2022 16:24
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
@colinmollenhour
colinmollenhour / Config.php
Last active April 22, 2020 09:45
Stampede-resistant Config Cache
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@avoelkl
avoelkl / gist:49563c516d6cb318eb34
Last active June 5, 2024 12:41
Non-blocking and quick database dumps for large databases

How-to

Add --single-transaction and --quick to your mysqldump command.

--single-transaction

sets the isolation mode to REPEATABLE READ and starts a transaction before dumping data. useful for InnoDB tables, dumps the consistent state without blocking any applications.

--quick

@a-r-m-i-n
a-r-m-i-n / FluidTemplate.html
Last active July 30, 2020 14:02
How to render responsive images in fluid templates (dce example)
{namespace dce=ArminVieweg\Dce\ViewHelpers}
<f:layout name="Default" />
<f:section name="main">
<f:for each="{dce:fal(field:'images', contentObject:contentObject)}" as="image">
<!-- This is the normal unresponsive way -->
<f:image image="{image}" />
<!-- Here we referer to typoscript to render the responsive image -->
<f:cObject typoscriptObjectPath="lib.responsiveImage" data="{image.uid}"></f:cObject>
</f:for>
@ursbraem
ursbraem / gist:f6b573724c9dad9724a0
Last active February 16, 2016 18:24
Tsconfig-all
options {
// enable upload fields in Element Browser
uploadFieldsInTopOfEB = 1
createFoldersInEB =1
//Add save-and-new to all forms
saveDocNew = 1
// better Page tree
pageTree {
showNavTitle = 1
showPageIdWithTitle = 1