Skip to content

Instantly share code, notes, and snippets.

View SchumacherFM's full-sized avatar

Cyrill Schumacher SchumacherFM

View GitHub Profile
@SchumacherFM
SchumacherFM / OAuth.php
Created March 26, 2014 00:38
Magento 1.7 and maybe 1.8 OAuth redirect bug according http://www.magentocommerce.com/boards/viewthread/438434/ This solution integrates without any rewrites or overrides.
<?php
class Zookal_Customer_Model_Observer_Controller_OAuth
{
/**
* @param string $url
*
* @return bool
*/
@SchumacherFM
SchumacherFM / keybase.md
Created April 1, 2014 09:03
Keybase proof

Keybase proof

I hereby claim:

  • I am schumacherfm on github.
  • I am cyrill (https://keybase.io/cyrill) on keybase.
  • I have a public key whose fingerprint is 076A 9DCE D5C2 63EE 438B 2BF7 3D7A E252 C8C7 9677

To claim this, I am signing this object:

@SchumacherFM
SchumacherFM / collection.php
Last active August 29, 2015 14:01
Singelton Collection Pattern #Magento
<?php
class Zookal_Core_Helper_Data extends Mage_Core_Helper_Abstract
{
private $_objectCache = [];
public function getCollectionSingleton($modelClass, array $collectionOptions = null, $cacheKey = null)
{
$cacheKey = null === $cacheKey ? $modelClass . '/' . json_encode($collectionOptions) : (string)$cacheKey;
// $cacheKey = md5($cacheKey); if preferred
@SchumacherFM
SchumacherFM / compare.md
Last active August 29, 2015 14:06
GoLang ListenAndServeTLS vs ListenAndServe
@SchumacherFM
SchumacherFM / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Created September 16, 2014 07:28 — forked from piotrekkaminski/PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Magento PATCH_SUPEE-389 to fix URL reindex bug. This bug regenerates in every run new URLs for existing product URLs.
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@SchumacherFM
SchumacherFM / local.xml
Last active August 29, 2015 14:08 — forked from alistairstead/local.xml
Magento local.xml skip_process_modules_updates
<?xml version="1.0"?>
<config>
<global>
<skip_process_modules_updates>1</skip_process_modules_updates>
</global>
</config>
@SchumacherFM
SchumacherFM / DISpeedTest.php
Created December 28, 2014 09:25
Magento2 Dependency Injection Speed Tester
<pre><?php
// call via http://mage2.dev/DISpeedTest.php
// change settings in app/etc/config.php
require('app/autoload.php');
Zend_Debug::dump(ini_get('memory_limit')); // should be > 1536MB
$start = microtime(true);
/*
bolt 5000 277963 ns/op
redis 30000 48081 ns/op
pg 10000 149691 ns/op
Yes, the Bolt transactions could be batched. But so too could the PG transactions,
and the Redis work could be pipelined. And that isn't always a workable solution.
*/
import (
@SchumacherFM
SchumacherFM / Trackingnumber.php
Created May 6, 2015 08:12
Magento1: How not to load models/collections in a grid renderer. This shows a very bad example 😞. Do not use it or 🔫.
<?php
/*
@SchumacherFM: The render() method is executed in each row
*/
/**
* Product: Vendor_GridActions
* ID:
* File: app/code/local/Vendor/GridActions/Block/Adminhtml/Sales/Order/Grid/Widget/Renderer/Trackingnumber.php