Skip to content

Instantly share code, notes, and snippets.

View fbrnc's full-sized avatar

Fabrizio Branca fbrnc

  • AOE
  • Wiesbaden, Germany
  • X @fbrnc
View GitHub Profile
@fbrnc
fbrnc / Varien_Cache_Backend_Database.patch
Created May 13, 2011 21:02
Patch for Magento's database backend
Index: lib/Varien/Cache/Backend/Database.php
===================================================================
--- lib/Varien/Cache/Backend/Database.php (revision 63515)
+++ lib/Varien/Cache/Backend/Database.php (working copy)
@@ -224,6 +224,7 @@
if ($this->_options['store_data']) {
$adapter = $this->_getAdapter();
$result = $adapter->delete($this->_getDataTable(), array('id=?'=>$id));
+ $tagResult = $adapter->delete($this->_getTagsTable(), array('cache_id=?' => $id));
return $result;
@fbrnc
fbrnc / Varien_Cache_Core.patch
Created May 13, 2011 21:04
Patch for Magento's two-level cache priority bug
Index: lib/Varien/Cache/Core.php
===================================================================
--- lib/Varien/Cache/Core.php (revision 63515)
+++ lib/Varien/Cache/Core.php (working copy)
@@ -70,7 +70,7 @@
* @throws Zend_Cache_Exception
* @return boolean True if no problem
*/
- public function save($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 8)
+ public function save($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 10)
@fbrnc
fbrnc / gist:1120909
Created August 2, 2011 18:59
Export comments to rss
page = PAGE
page.config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
disablePrefixComment = 1
noPageTitle = 1
# xmlprologue = xml_11
additionalHeaders = Content-type:application/rss+xml
@fbrnc
fbrnc / gist:1128283
Created August 5, 2011 19:19
ZendStudio Code Template
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="php" deleted="false" description="" enabled="true" name="ti">/* @var ${variable} ${class} */</template>
</templates>
@fbrnc
fbrnc / gist:1255052
Created September 30, 2011 21:42
Database Cache Backend Bug in Magento Enterprise Edition
265,266c265,266
< 'expire_time> ?' => 0,
< 'expire_time<= ?' => time()
---
> 'expire_time>' => 0,
> 'expire_time<=' => time()
@fbrnc
fbrnc / gist:1262502
Created October 4, 2011 19:12
Magento priority configuration for TwoLevels cache backend
Index: app/code/core/Mage/Core/Model/Cache.php
===================================================================
--- app/code/core/Mage/Core/Model/Cache.php (revision 124392)
+++ app/code/core/Mage/Core/Model/Cache.php (working copy)
@@ -44,7 +44,7 @@
/**
* Cache frontend API
*
- * @var Zend_Cache_Core
+ * @var Varien_Cache_Core
@fbrnc
fbrnc / .inputrc
Created October 19, 2011 12:46
My inputrc configuration
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
# Pos1 / Ende to jump within line
"\e[h": beginning-of-line
"\e[f": end-of-line
"\e[1~": beginning-of-line
"\e[4~": end-of-line
@fbrnc
fbrnc / typo3.xml
Created October 20, 2011 10:50
Code formatter for ZendStudio for TYPO3 Coding Guidelines
<?xml version="1.0" encoding="UTF-8"?>
<profiles>
<profile name="TYPO3">
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_force_split" value="false"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_indent_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_line_wrap_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_force_split" value="false"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_indent_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_line_wrap_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_assignment_force_split" value="false"/>
@fbrnc
fbrnc / .bashrc
Created October 20, 2011 10:57
Additions to ~/.bashrc
alias ll='ls -lha'
# redirect svn diff output to colordiff
svndiff() {
svn diff "${@}" | colordiff
}
# ignore whitespaces
svndiff-white() {
svn diff --diff-cmd diff -x -uw "${@}" | colordiff
@fbrnc
fbrnc / default.vcl
Created October 27, 2011 07:34
Aoe_Static vcl for Varnish 3
backend default {
.host = "127.0.0.1";
.port = "80";
.first_byte_timeout = 300s;
}
/*
Like the default function, only that cookies don't prevent caching
*/
sub vcl_recv {