Skip to content

Instantly share code, notes, and snippets.

View jonpday's full-sized avatar

Jonathan Day jonpday

View GitHub Profile
@dng-dev
dng-dev / Mage_Eav_Model_Entity_Abstract
Created September 28, 2017 18:02
improves eav based loads
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@vancluever
vancluever / gnome-tracker-disable.md
Last active July 21, 2024 18:10
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@IvanChepurnyi
IvanChepurnyi / Proposal.md
Last active June 26, 2020 22:22
Architectural Proposal for Magento 2 Inventory and Prices Mechanism

Problem

There are too tight relations of stock and prices to store views and websites in Magento that results in high complexity of implementation of b2b and drop shipping solutions in Magento.

The issue was very visible with the price index structure for Magento 1, and now Magento 2 stock index follows the same idea of having an index entry per website.

This strict relation to a website makes unnecessary data duplications in case if you have global stock. Although it makes over complicated multi-warehouse delivery, as you will be required to create a separate website for each warehouse, that duplicates other product data in the flat index structure and price index.

Solution

Create a separate scope entity for Price and Inventory, for using them as scope fields for respective data structures.

@vpietri
vpietri / datataflow.php
Last active June 19, 2020 16:09
Magento shell script to run dataflow from the command line
<?php
require_once 'abstract.php';
/**
* Magento Dataflow Shell Script
*
* This file should be save in the shell directory of Magento
* Basic usage samples:
* php dataflow.php
* php dataflow.php list
@rmasters
rmasters / ngrok.sh
Last active June 11, 2017 15:29
Bare-bones ngrok SysV init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: ngrok
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the ngrok connection
# Description: starts ngrok using start-stop-daemon
### END INIT INFO
@jarvys
jarvys / run-multiple-redis-instances.md
Last active September 27, 2022 13:02
run multiple redis instances on the same server for centos
  • create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
  • edit /etc/redis-xxx.conf, illustrated as below
...

Magento Scaling Hypotheses

Magento’s checkout throughput can increase to at least 8 times its current capacity and up to 26 times more in ideal conditions.

  1. The current checkouts per hour limit for large, real-world Magento stores is 4,500
  2. This limit cannot effectively be increased with more and/or better hardware
  3. The improper type handling in Magento’s SQL code is the cause of the current limit
  4. If one SQL query is fixed, large Magento stores can scale to a new, real-world limit of 120,000 checkouts per hour
  5. For commodity hardware, this new limit might be 36,000 checkouts per hour
@nikolazic
nikolazic / tar_magento_media_exclude.sh
Last active September 9, 2021 14:38
Tar Magento Media directory excluding cache files
tar -cvf ~/media-`date +%Y%m%d`.tar --exclude-vcs --exclude='*.htaccess' --exclude='*/cache/*' --exclude='*/cache' --exclude='*/.thumbs/*' --exclude='*/.thumbs' --exclude='*/tmp/*' --exclude='*/tmp' --exclude='*/js/*' --exclude='*/js' --exclude='*/css/*' --exclude='*/css' --exclude='*/captcha/*' --exclude='*/captcha' --exclude='*/css_secure/*' --exclude='*/css_secure' --exclude='*/customer/*' --exclude='*/customer' --exclude='*/dhl/*' --exclude='*/dhl' --exclude='*/downloadable/*' --exclude='*/downloadable' --exclude='*/xmlconnect/*' --exclude='*/xmlconnect' media
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@markshust
markshust / magento-mysql.5.6-innodb-fix.diff
Last active December 23, 2015 04:39
Magento - MySQL 5.6 InnoDB fix
diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php
index bc482b5..ebd5875 100644
--- a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php
+++ b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php
@@ -59,7 +59,7 @@ class Mage_Install_Model_Installer_Db_Mysql4 extends Mage_Install_Model_Installe
public function supportEngine()
{
$variables = $this->_getConnection()
- ->fetchPairs('SHOW VARIABLES');
- return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true;