Skip to content

Instantly share code, notes, and snippets.

View aleron75's full-sized avatar

Alessandro Ronchi aleron75

View GitHub Profile
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@Ocramius
Ocramius / BasicDicContainer.php
Created July 20, 2012 17:02
DIC container 101 in PHP
<?php
class B {
protected $c;
public function __construct(C $c) {
$this->c = $c;
}
}
class C {}
@peterjaap
peterjaap / quickmodman
Created January 16, 2013 10:52
Quickly generate modman file for Magento extensions
for i in `find . -type f | grep -v \.git | grep -v "^.$" | grep -v "modman" | sed 's/\.\///'`; do echo ${i} ${i}; done > modman
@parhamr
parhamr / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Last active October 13, 2023 14:20
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.
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;
@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:

@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.

@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active May 23, 2022 12:28
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@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
@magentogirl
magentogirl / gist:e8dc6aa7c74d021f85cc
Last active January 8, 2019 11:32
config.xml to disable Magento Logging
<?xml version="1.0"?>
<config>
<frontend>
<events>
<!--disable logs-->
<controller_action_predispatch>
<observers><log><type>disabled</type></log></observers>
</controller_action_predispatch>
<controller_action_postdispatch>
<observers><log><type>disabled</type></log></observers>