Skip to content

Instantly share code, notes, and snippets.

View mklooss's full-sized avatar

Mathis Klooß mklooss

View GitHub Profile
@mklooss
mklooss / configurable.phtml
Created October 22, 2014 08:29
Show Attribute Name in Select Box on an Configurable Product
<script type="text/javascript">
Product.Config.prototype.fillSelect = function(element){
var attributeId = element.id.replace(/[a-z]*/, '');
var options = this.getAttributeOptions(attributeId);
this.clearSelect(element);
element.options[0] = new Option('', '');
element.options[0].innerHTML = this.config.attributes[attributeId].label + ' <?php echo $this->__('Choose') ?>';
var prevConfig = false;
if(element.prevSetting){
@mklooss
mklooss / Observer.php
Created October 22, 2014 12:21
AutoUpselling Based on Orders
<?php
class Custom_Modul_Model_Autoupsell_Observer
{
/**
* @mageEvent sales_order_place_after
*/
public function autoUpsell($event)
{
$upsell = Mage_Catalog_Model_Product_Link::LINK_TYPE_UPSELL;
@mklooss
mklooss / README
Created October 28, 2014 08:37
PepperFlash in Chromium Browser on Debian/Ubuntu from Google Chrome
Inspirated by the Debian Package [1]
To provide PepperFlash also in Chromium Browser on Debian/Ubuntu, without installing the pepperflash Package from Debian.
This Method required an installed google-chrome Browser.
[1] https://packages.debian.org/search?keywords=pepperflashplugin-nonfree
@mklooss
mklooss / jemalloc-stats-print
Created November 19, 2014 15:45
HHVM memory leak info HHVM issue: #4268
___ Begin jemalloc statistics ___
Version: 3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340
Assertions disabled
Run-time option settings:
opt.abort: false
opt.lg_chunk: 22
opt.dss: "secondary"
opt.narenas: 1
opt.lg_dirty_mult: 3
opt.stats_print: false
@mklooss
mklooss / Magento-diff-1.9.0.1-1.9.1.0.text
Last active August 29, 2015 14:10
Magento design/skin compare between 1.9.0.1 and 1.9.1.0
Diff Between Magento 1.9.0.1 and Magento 1.9.1.0
- No Licence Header changes in this diff
So it looks like an Magento 1.9.0.1 Design will work in Magento 1.9.1.0
The MessageBlock has been Changed in every file (old method exists in Message Class), the output is excatly the same as before!
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
to
<?php echo $this->getMessagesBlock()->toHtml() ?>
#!/usr/bin/perl
use strict ;
use warnings ;
use constant DEBUG => 0 ;
my $adjtimex = q{/sbin/adjtimex} ;
open my $cmdpipe, "$adjtimex --print |" ;
@mklooss
mklooss / fix-hhvm-packages.txt
Last active August 29, 2015 14:13
fix unsupported packages from HHVM Repository
# older releases of HHVM needs newer version of this Debian files.
# Facebook has removed this files so you have some unsuported packages in your system
# with this lines you can revert to the debian default packages!
apt-get update
mkdir -p /tmp/pkgs
cd /tmp/pkgs
wget http://ftp.de.debian.org/debian/pool/main/g/gcc-4.7/libstdc++6_4.7.2-5_amd64.deb \
http://ftp.de.debian.org/debian/pool/main/e/eglibc/locales_2.13-38+deb7u6_all.deb \
http://ftp.de.debian.org/debian/pool/main/e/eglibc/locales-all_2.13-38+deb7u6_amd64.deb \
@mklooss
mklooss / FixImages.php
Last active August 29, 2015 14:14
set Default Product Image, when it is not set yet
<?php
/*
set Default Product Image, when it is not set yet
*/
if(!isset($argv))
{
die('only via cli');
exit;
@mklooss
mklooss / crontab
Last active August 29, 2015 14:15
automatic print pdf
*/1 * * * * root find /printer -iname "*.pdf" -exec printpdf "{}" \; > /dev/null
@mklooss
mklooss / 08_del_ahbl.patch
Last active August 29, 2015 14:15
remove rhsbl.ahbl.org from in debian wheezys policyd-weight
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>