Skip to content

Instantly share code, notes, and snippets.

View Flyingmana's full-sized avatar
📄
Fighting against bureaucracy

Daniel Fahlke Flyingmana

📄
Fighting against bureaucracy
View GitHub Profile
@woodworker
woodworker / php_switch_hate.php
Created February 17, 2011 14:44
Sometimes i really hate PHP :D
<?php
$a = 0;
switch ($a) {
case 'test':
$b = 'TEST';
break;
default:
$b = 'DEFAULT';
}
@yellowled
yellowled / .htaccess
Created April 1, 2013 14:35
gzip aktivieren auf Uberspace
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
@edannenberg
edannenberg / magento_url_rewrite.patch
Last active August 11, 2022 17:27
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x See https://github.com/magento/bugathon_march_2013/issues/265 for details.Update: DexterDee in the ticket above noted that the previous patch had some side effects. This updated patch still feels like duct tape but at least it seems to be free of the mentioned side effects. It also fix…
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@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
<?php
// tested on php 5.4.4 on freebsd
// tested on php 5.5.9 on windows
// rename the error routes to e403 and e404, and this does not happen.
// -or-
// $array = get_object_vars($object->ErrorRoutes);
$json = <<< 'EOF'
@sebastianwagner
sebastianwagner / .gitignore
Last active July 25, 2016 12:46
Magento Core through composer
/vendor/
/htdocs/
composer.lock
@mattparker
mattparker / install-and-compile-php7
Last active November 28, 2021 17:36
running php tests with lcov/gcov - setup and getting close
# install lcov
apt-get update
apt-get install lcov
mkdir /usr/local/php70-gcov5
cd ~/php-src
./configure --enable-gcov --prefix=/usr/local/php70-gcov5 --with-apxs2=/usr/bin/apxs2 --with-gd --without-pear --with-jpeg-dir=/usr --with-png-dir=/usr --with-vpx-dir=/usr --with-freetype-dir=/usr --with-t1lib=/usr --enable-gd-native-ttf --enable-exif --with-config-file-path=/etc/php7 --with-config-file-scan-dir=/etc/php7/conf.d --with-mysql=/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-zlib --with-gmp --with-zlib-dir=/usr --with-gettext --with-kerberos --with-imap-ssl --with-mcrypt=/usr/local --with-iconv --enable-sockets --with-openssl --with-pspell --with-pdo-mysql=mysqlnd --with-pdo-sqlite --enable-soap --enable-xmlreader --with-xsl --enable-ftp --enable-cgi --with-curl=/usr --with-tidy --with-xmlrpc --enable-mbstring --enable-sysvsem --enable-sysvshm --enable-shmop --with-readline --enable-fpm --enable-intl --enable-zip --with-imap --with-mysqli=mysqlnd --enable-calendar
make
make install
@rafaelstz
rafaelstz / Install-Magento-1.md
Last active September 23, 2024 04:30
Install Magento 1.9 (With Sample Data)
  
  ## Magento 1 + SampleData
  
  sudo apt-get update && \
  sudo apt-get install -y git wget unzip
  
  git clone https://github.com/OpenMage/magento-mirror.git ./ ;

  wget https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz ;
@Deepakkothandan
Deepakkothandan / xdebug.ini
Last active June 9, 2017 14:14
xdebug config for vagrant
zend_extension=xdebug.so
;xdebug.idekey = "PHPSTORM"
;xdebug.default_enable = 1
;xdebug.remote_enable = 1
;xdebug.remote_autostart = 0
;xdebug.remote_port = 9000
;xdebug.remote_handler=dbgp
;xdebug.remote_connect_back = 1