Skip to content

Instantly share code, notes, and snippets.

grafikchaos /
Last active Aug 23, 2018
Magento 2 Installation via command line

Install Magento 2 Community Edition (CE)

Via Composer

You can use the Magento integrator instructions to install download/install Magento 2 via composer

Get the Magento CE metapackage

To get started:

View Magento Failure Page Themeing
Locate This File: /app/code/core/Mage/Checkout/controllers/OnepageController.php
Go to Mage_Checkout_OnepageController::successAction()
Comment the line $session->clear();.
Now you can make one order and refresh the page as often as you like for styling the success page,
simply put through a test order and once you are on the success page just change the url
from /checkout/onepage/success/ to /checkout/onepage/failure/
aleron75 / shell_delete_unused_images
Last active Sep 17, 2021
Delete no more used Product Images on Magento 1
View shell_delete_unused_images
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
hopsoft / db.rake
Last active Nov 4, 2021
Rails rake tasks for dump & restore of PostgreSQL databases
View db.rake
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
puts cmd
krisanalfa /
Last active Sep 2, 2021 — forked from gido/
Install OCI8 and / or PDO_OCI on OSX via Brew


This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.


Download the following files from Oracle website (yes, you need to create an account and accept terms):

frozenminds / clean-magento_ce-db-extended.sql
Created May 12, 2014
Clean Magento database of junk and unnecessary data
View clean-magento_ce-db-extended.sql
-- Magento CE database clean-up extended
-- This is an extended clean-up which will clean search, import/export, reports, etc.
-- @author Constantin Bejenaru <>
-- @copyright Copyright (c) Constantin Bejenaru (
-- @license MIT License
petemcw /
Last active Nov 15, 2021
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.test domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
petemcw /
Last active Oct 25, 2021
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup


peterjaap / Magento generated events
Created Oct 14, 2013
Magento generated events; a number of models use automatically generated events through prefixes. This is a (non-exhaustive) list of a number of those events, combined with _save_before, _save_after, _save_commit_after, _delete_before, _delete_after, _delete_commit_after, _load_before & _load_after.
View Magento generated events
raphaelstolt /
Last active Apr 16, 2018
Short guide on migrating from homebrew-php to phpbrew

#Migrating from homebrew-php to phpbrew

After installing phpbrew it's time to install a set of chosen PHP versions. My picks at the time of this writing were:

sudo phpbrew install php-5.5.0 +default+dbs+mb+apxs2=/usr/sbin/apxs
sudo phpbrew install php-5.4.17 +default+dbs+mb+apxs2=/usr/sbin/apxs
sudo phpbrew install php-5.3.27 +default+dbs+mb+apxs2=/usr/sbin/apxs

When not sure where apxs is located on your system, whereis apxs is quite chatty.