Skip to content

Instantly share code, notes, and snippets.


Steve Robbins steverobbins

View GitHub Profile
mttjohnson /
Last active Feb 25, 2020
MySQL DB snapshot separating tables into files for comparison purposes
#!/usr/bin/env bash
# Copyright © 2017 by Matt Johnson. All rights reserved
# Licensed under the Open Software License 3.0 (OSL-3.0)
# See included LICENSE file for full text of OSL-3.0
iben12 /
Last active Sep 9, 2021
Laravel: State-machine on Eloquent Model

Implementing State Machine On Eloquent Model*

* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.

Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.

Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.

That's the theory, let's get to the work.

molotovbliss / betterindexer.php
Last active May 1, 2017
Magento: only reindex invalidated indexes shell/indexer.php replacement
View betterindexer.php
* Add the parameter "reindexallrequired" to only index the indexers
* that are in need of processing to avoid doing full reindexes
* that disregard the state of the index as indexer.php does
* Usage:
* php shell/betterindexer.php reindexallrequired
piotrekkaminski / gist:9bc45ec84028611d621e
Last active Oct 14, 2019
How to automatically download patches and release of Magento
View gist:9bc45ec84028611d621e
1) First you need to generate download token. Login to your account on and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k
4) Profit!
gwillem / magento-nginx.conf
Last active Aug 9, 2021
Battle-tested Nginx configuration for Magento (source:
View magento-nginx.conf
# This is an annotated subset of the Nginx configuration from our Magento production platform @
# See
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/;
events {
vpietri / datataflow.php
Last active Jun 19, 2020
Magento shell script to run dataflow from the command line
View datataflow.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
mpchadwick / Mpchadwick_Missing_Acl_Checker.php
Created Jul 11, 2015
View Mpchadwick_Missing_Acl_Checker.php
require_once 'abstract.php';
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed()
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract
const MODULES_PATH = 'modules';
View SupportDesk_FixAcl.php
* SupportDesk_FixAcl.php v1.1
* SupportDesk (
* 10/7/2015
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL:
steverobbins / magento-ioncube-module-info.php
Last active May 12, 2021
Display what information we can about Magento1 objects that are ioncubed (or any class really)
View magento-ioncube-module-info.php
<?php ini_set('display_errors', 1) ?>
<link rel="stylesheet" href="">
<script src=""></script>
// we need the autoloader
include 'app/Mage.php';
$classes = array(
View package2modman.php
* Generate modman file from Magento Connect 2.0 package.xml
* Usage:
* php package2modman.php path/to/package.xml > path/to/modman
require_once(__DIR__ . "/../www/app/Mage.php");