Skip to content

Instantly share code, notes, and snippets.

@mpchadwick
mpchadwick / magento-cl-index-status.sql
Created September 27, 2016 19:48
magento-cl-index-status
SELECT
emm.table_name AS "Index",
emm.version_id AS "Last Run Version",
COALESCE(
eurrc.version,
cissc.version,
csfc.version,
eurcc.version,
eurpc.version,
ccpic.version,
@mpchadwick
mpchadwick / proposed-fpc-route-ttl-configuration.xml
Created October 7, 2016 15:32
proposed-fpc-route-ttl-configuration.xml
<!-- Before -->
<cache>
<requests>
<catalog>
<category>
<view>enterprise_pagecache/processor_category</view>
</category>
</catalog>
</requests>
</cache>
@mpchadwick
mpchadwick / gatling-simulation.scala
Created October 12, 2016 14:21
gatling-simulation.scala
class Scenario extends Simulation {
val httpProtocol = http
.baseURL("https://example.com")
.inferHtmlResources(BlackList(""".*media.*""", """.*\.js""", """.*\.css""", """.*\.gif""", """.*\.jpeg""", """.*\.jpg""", """.*\.ico""", """.*\.woff""", """.*\.(t|o)tf""", """.*\.png"""), WhiteList(""".*example.com.*"""))
val headers = Map("Upgrade-Insecure-Requests" -> "1")
/////////////////////
// BouncerHome
/////////////////////
@mpchadwick
mpchadwick / emoji-usage-analyzer.php
Created December 21, 2016 01:46
emoji-usage-analyzer.php
<?php
class Analyzer
{
const MAX_TO_CHECK = 1000;
protected $dirs;
protected $emojis;
public function __construct()
@mpchadwick
mpchadwick / pre-commit
Created December 23, 2016 14:11
pre-commit
#!/usr/bin/env php
<?php
$projectName = basename(getcwd());
exec('vendor/bin/phpunit', $output, $returnCode);
if ($returnCode !== 0) {
$minimalTestSummary = array_pop($output);
printf("Test suite for %s failed: ", $projectName);
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL);
printf("ABORTING COMMIT!\n");
- Break large features up into multiple commits
- Don't submit a massive PR
- Link to PRs where code has previously been reviewed
- Write good commit messages
- Make sure the site isn't broken in any of your commits
- Avoid reformatting
- Write a good comment when submitting your PR
- Include screenshots for significant front end changes
- Don't Involve Multiple Reviewers
- Don't Submit Net New Code After Changes Have Been Requested On A Reviewed PR
@mpchadwick
mpchadwick / flush-magento-home-page-fpc.sh
Created January 18, 2017 16:02
flush-magento-home-page-fpc.sh
php -r 'require_once("app/Mage.php"); Mage::app(); $id = Mage::getModel("cms/page")->load(Mage::getStoreConfig("web/default/cms_home_page"))->getId(); Enterprise_PageCache_Model_Cache::getCacheInstance()->clean("CMS_PAGE_" . $id);'
@mpchadwick
mpchadwick / PATCH_SUPEE-9465_EE_1.14.3.0_v1.sh
Created January 21, 2017 01:47
PATCH_SUPEE-9465_EE_1.14.3.0_v1.sh
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@mpchadwick
mpchadwick / PATCH_SUPEE-9652_ee-ce_v2-2017-02-06-07-34-53.sh
Created February 7, 2017 21:00
PATCH_SUPEE-9652_ee-ce_v2-2017-02-06-07-34-53.sh
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
# generated by Chef for node localhost
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with