Skip to content

Instantly share code, notes, and snippets.

@azet
azet / proper_bash.md
Last active August 29, 2015 14:02
hitchhikers guide to writing useful and modern bash scripts
@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
@Vinai
Vinai / gist:1205913
Created September 9, 2011 10:32
Bug with store cookie handling in Magento up to 1.6 if specifying a non-default store MAGE_RUN_CODE
--- a/app/code/core/Mage/Core/Model/App.php
+++ b/app/code/core/Mage/Core/Model/App.php
@@ -511,11 +511,7 @@ class Mage_Core_Model_App
if ($this->_currentStore == $store) {
$store = $this->getStore($store);
- if ($store->getWebsite()->getDefaultStore()->getId() == $store->getId()) {
- $this->getCookie()->delete(Mage_Core_Model_Store::COOKIE_NAME);
- } else {
- $this->getCookie()->set(Mage_Core_Model_Store::COOKIE_NAME, $this->_currentStore, true);
@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 */
@geoff-nixon
geoff-nixon / gitsvndiff
Last active May 30, 2016 14:23 — forked from katta/gitdiff-svnpatch.sh
Use 'git diff' to produce subversion style patches.
#!/bin/sh
svnstyle(){ sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" -e 's/@@\(.*\)@@.*/@@\1@@/g' ;}
DIFFPARAMS='--no-prefix --ignore-space-at-eol --minimal'
git diff $DIFFPARAMS "$@" | svnstyle
@razbakov
razbakov / modman-generator.sh
Last active August 9, 2016 16:28
Generate modman file
#!/bin/sh
#
# Generates magento modman file
#
# INSTALLATION:
# Save this file to /opt/deploy/tools/modman-generator.sh
# ln -s /opt/deploy/tools/modman-generator.sh /usr/local/bin/mg
# chmod a+x /usr/local/bin/mg
#
# USAGE:
@molotovbliss
molotovbliss / gist:c36c25b7a08afda2848b
Last active November 16, 2016 02:20 — forked from magentogirl/gist:e8dc6aa7c74d021f85cc
Disable Magento Logging observers & unused Core Modules via XML
<?xml version="1.0"?>
<config>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
<observers><log><type>disabled</type></log></observers>
</controller_action_predispatch>
<controller_action_postdispatch>
<observers><log><type>disabled</type></log></observers>
@schumachera
schumachera / speep_up_catalog_category_product_indexer.md
Last active March 21, 2017 15:53
Speed up catalog_category_product full reindexing in Magento 1 EE

Speed up Magento EE 1.x catalog_category_product indexer

For refreshing the catalog_category_product index Magento EE generates SQL queries with joins over many tables to determine which product relates to what category and may show up in what category.

The queries fired by the indexer will look something like this:

INSERT IGNORE INTO `catalog_category_product_index_tmp` (`category_id`, `product_id`, `position`, `is_parent`, `store_id`, `visibility`) SELECT `cc`.`entity_id` AS `category_id`, `ccp`.`product_id`, ccp.position + 10000 AS `position`, 0 AS `is_parent`, 20 AS `store_id`, IFNULL(cpvs.value, cpvd.value) AS `visibility` FROM `catalog_category_entity` AS `cc`
 INNER JOIN `catalog_category_entity` AS `cc2` ON cc2.path LIKE CONCAT(`cc`.`path`, '/%') AND cc.entity_id NOT IN (1)
 INNER JOIN `catalog_category_product` AS `ccp` ON ccp.category_id = cc2.entity_id
@harlesc
harlesc / PHP7 Magento 1.9 core patch.md
Last active April 9, 2017 20:31
Patch to get Magento 1.9 working with >= PHP 7.0.0 RC 6

Patch using method below or if you don't want to patch a core file, see this Magento extension that does the same thing but correctly overrides the core file:
https://github.com/MageMechanic/PhpSeven

# run in magento root directory

# one-liner to apply patch using wget
wget -qO- 'https://gist.githubusercontent.com/MageMechanic/66449504110fbbd96214/raw/php7_magento_1_9_core.patch' | patch -p0

# one-liner to apply patch using curl
@piotrekkaminski
piotrekkaminski / docker_beta.md
Last active April 10, 2017 23:56
Docker Beta Installation Info & FAQ