Skip to content

Instantly share code, notes, and snippets.

@fbrnc
fbrnc / Varien_Cache_Backend_Database.patch
Created May 13, 2011
Patch for Magento's database backend
View Varien_Cache_Backend_Database.patch
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
Patch for Magento's two-level cache priority bug
View Varien_Cache_Core.patch
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 Aug 2, 2011
Export comments to rss
View gist:1120909
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 Aug 5, 2011
ZendStudio Code Template
View gist:1128283
<?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 Sep 30, 2011
Database Cache Backend Bug in Magento Enterprise Edition
View gist:1255052
265,266c265,266
< 'expire_time> ?' => 0,
< 'expire_time<= ?' => time()
---
> 'expire_time>' => 0,
> 'expire_time<=' => time()
@fbrnc
fbrnc / gist:1262502
Created Oct 4, 2011
Magento priority configuration for TwoLevels cache backend
View gist:1262502
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 Oct 19, 2011
My inputrc configuration
View .inputrc
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 Oct 20, 2011
Code formatter for ZendStudio for TYPO3 Coding Guidelines
View typo3.xml
<?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 Oct 20, 2011
Additions to ~/.bashrc
View .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 Oct 27, 2011
Aoe_Static vcl for Varnish 3
View default.vcl
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 {