Skip to content

Instantly share code, notes, and snippets.

View aleron75's full-sized avatar

Alessandro Ronchi aleron75

View GitHub Profile
@kalenjordan
kalenjordan / magento-admin-gamification.md
Last active August 29, 2015 13:56
Magento Admin Gamification

Magento Admin Gamification

The Idea

The idea is to use gamification in the Magento backend to help to train admins who are new to using Magento with some kind of interactive tutorial along with earning points for doing things like updating their store address in system config and creating a new product, etc.

How Would It Work

Not totally sure, just a rough idea right now. But my thinking is - some combination of an interactive tutorial with points and badges earned for different actions.

@wsakaren
wsakaren / magento2_install
Last active August 29, 2015 14:11
Installing Magento2 - The quick way
So we all hate reading docs. Here is the quick setup for installing Magento2. If you want the long route - http://devdocs.magento.com/
I'm assuming you have composer, PHP 5.4+ and MySQL5.6+. If you have MAMP installed time to go sort that as it wont work (MAMP is on MySQL5.5.x).
1. Install Composer - curl -sS https://getcomposer.org/installer | php
2. mv composer.phar /usr/local/bin/composer (might need to sudo)
3. Goto base httpdocs directory
4. git clone git@github.com:magento/magento2.git
5. Set permissions (like you do in Magento 1.x)
6. cd magento2
@mam08ixo
mam08ixo / data-upgrade-0.1.67-0.1.68.php
Last active October 30, 2015 22:02 — forked from avoelkl/upgrade-0.1.67-0.1.68.php
SUPEE-6788 variable + block setup script. 1.) Create a new module or extend a current one. 2.) Create a new install or setup script with the variables and blocks which are not whitelisted yet.
<?php
/**
* @category Namespace
* @package Namespace_Module
* @author Anna Völkl
* @author Christoph Aßmann
* @author Fabian Schmengler
*/
/** @var Mage_Core_Model_Resource_Setup $installer */
@avoelkl
avoelkl / magestackday.md
Last active June 18, 2016 15:54
MageStackDay little helpers

MageStackDay notes & queries

Some notes from the MageStackDay chat:

  • save your votes. Marius can close unlimited nrs of questions so he'll do that, just vote / flag once is enough!
  • If you can clean up the spelling and grammar on the question, feel free to do so, as it would be easier for non-english speakers
  • use your votes

Queries

Questions to work on

@magentogirl
magentogirl / mage-customer-balance-sql
Created May 8, 2014 15:40
Magento Enterprise Report of Customers with a Store Credit Balance
select customer_id, email, f.value, l.value, amount from enterprise_customerbalance b join customer_entity c on
b.customer_id=c.entity_id
left join customer_entity_varchar f on c.entity_id =f.entity_id
left join customer_entity_varchar l on c.entity_id =l.entity_id
where amount>0 and f.attribute_id=5 and l.attribute_id=7
@xsist10
xsist10 / Dispatch1.php
Last active January 21, 2017 17:28
An event dispatcher in a tweet
<?php
// Version 1
// Minified
// class Dispatch{function add($e,$l){$this->l[$e][]=$l;}function trigger($e,$d){foreach ($this->l[$e] as $l)call_user_func_array($l, $d);}}
class Dispatch{
function add($e, $l) {
$this->l[$e][] = $l;
@jm42
jm42 / c.php
Created October 31, 2014 04:31
IoC in a tweet
<?php // php -dallow_url_include=1 c.php
// Compressed 122 bytes
// class C extends ArrayObject { function __get($i) { $s = $this[$i]; $s instanceof Closure && $s = $s($this); return $s; } }
class C extends ArrayObject {
function __get($i) {
$s = $this[$i];
$s instanceof Closure && $s = $s($this);
return $s;
@edannenberg
edannenberg / magentrolol.md
Last active January 26, 2017 17:41
Magento 1.8.x tax calculation when using prices including tax.

We upgraded to 1.8 a couple of weeks ago, today i had to investigate this little gem:

trolol

The issue was reproducable by adding 3 of the above items to the cart, checking the db confirmed that the 2nd quote item already had the wrong tax value.

Digging down the culprit turned out to be in Mage_Tax_Model_Sales_Total_Quote_Subtotal and Mage_Tax_Model_Sales_Total_Quote_Tax:

collect() will call for each quote item:

@fbrnc
fbrnc / setup.sh
Last active March 5, 2017 01:53
X2GO PHPStorm Demo
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install software-properties-common
# X2Go
add-apt-repository -y ppa:x2go/stable && apt-get update
apt-get -y install x2goserver
# Download PHPStorm
@IvanChepurnyi
IvanChepurnyi / optimize-composer.sh
Created September 30, 2016 16:00
Optimizes autoloader for the best performance on production system
#!/bin/bash
magentodir=$1
cd $magentodir
read -d '' script << PHP
<?php
\$composer = json_decode(file_get_contents('composer.json'), true);
if (!is_array(\$composer['autoload']['psr-0'][''])) {