Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View leek's full-sized avatar

Chris Jones leek

View GitHub Profile
@leek
leek / _Magento2_DeleteTestData.md
Last active January 10, 2024 05:39
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@leek
leek / WritingMagentoModules.md
Created July 8, 2013 21:51
Writing Modules for Magento 1.x

Writing Magento Modules

All custom modules should have a Namespace and Module Name. These are used below as {Namespace} and {Module}.

Caution: The Magento autoloader is known to have problems with CamelCase namespaces and/or modules between Windows and *nix systems. If your module requires more than one word for either of these, it is best to just concatenate them to avoid any issues (Example: {Namespace}_{Examplemodule}).

Index

@leek
leek / _Magento1_DeleteTestData.md
Last active December 29, 2023 09:51
Magento 1 - Delete All Test Data

These set of scripts are for Magento 1. For Magento 2, see this Gist.

<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
@leek
leek / homestead.md
Last active September 16, 2022 21:39
Instructions for setting up and using Homestead

Homestead Setup

  1. (Mac Only) Install Homebrew:

     /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  2. (Mac Only) Install Caskroom:

     brew tap caskroom/cask
    
@leek
leek / magento_2_dump_and_die.php
Last active July 21, 2022 11:08
Laravel dd() for Magento 2
<?php
function d($arg) {
if (is_object($arg)) {
echo PHP_EOL . 'CLASS: ' . get_class($arg) . PHP_EOL;
if ($arg instanceof \Magento\Framework\DB\Select) {
var_dump($arg->__toString());
}
if (method_exists($arg, 'getSelect')) {
var_dump($arg->getSelect()->__toString());
@leek
leek / .php-cs-fixer.dist.php
Created July 11, 2022 04:50
Personal ideal PHP CS Fixer configuration
<?php
/**
* PHP Coding Standards fixer configuration
*/
$finder = PhpCsFixer\Finder::create()
->ignoreDotFiles(true)
->ignoreVCSIgnored(true)
->exclude('node_modules')
@leek
leek / deploy.sh
Last active May 31, 2022 23:53
Magento 2 Deployment Script
#!/bin/bash
LOCKFILE=deploy.lock
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
echo "-- ERROR"
echo "-- Deployment is already running"
exit
fi
@leek
leek / tools.md
Last active April 14, 2022 03:16
Helpful list of tools and things that I want to remember.

Includes:

  • Configuration
  • BrowserSync
  • Environments (e.g.,: --environment=production)
  • Image optimization (gif, jpg, png, and svg)
  • Sass compilation with external libraries
  • Bower installed Sass libraries example(s)
  • CSS processing with Pleeease