Skip to content

Instantly share code, notes, and snippets.

View steverobbins's full-sized avatar

Steve Robbins steverobbins

View GitHub Profile
@piotrekkaminski
piotrekkaminski / gist:9bc45ec84028611d621e
Last active July 2, 2025 00:06
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com 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 https://MAGEID:[email protected]/products/downloads/info/help
4) Profit!
@molotovbliss
molotovbliss / betterindexer.php
Last active May 1, 2017 20:37
Magento: only reindex invalidated indexes shell/indexer.php replacement
<?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
*
* http://magento.stackexchange.com/a/62272/69
@iben12
iben12 / 1_Laravel_state-machine.md
Last active August 12, 2023 08:36
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.

@mttjohnson
mttjohnson / dbsnapshot.sh
Last active February 25, 2020 12:01
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
#
# https://github.com/mttjohnson
##