Skip to content

Instantly share code, notes, and snippets.

View petemcw's full-sized avatar

Pete McWilliams petemcw

View GitHub Profile
@petemcw
petemcw / docker_instructions.md
Last active October 22, 2020 21:24
Mac OS X Docker Instructions using Dinghy

Docker Installation

A great way to get Docker running smoothly on OS X is to use the awesome project Dinghy. It is basically:

Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.

Some of the benefits are:

  • Faster volume sharing using NFS rather than built-in virtualbox/vmware file shares
  • Filesystem events work on mounted volumes
@petemcw
petemcw / CustomerSessionCheck.php
Created July 13, 2018 15:03
Magento 2.x Is Customer Logged In?
<?php
namespace Petemcw;
use Magento\Customer\Model\Session;
class Customer
{
/**
* @var \Magento\Customer\Model\Session
@petemcw
petemcw / sphp.sh
Created November 19, 2018 20:59
Switch PHP versions script
#!/usr/bin/env bash
BREW_PREFIX=$(brew --prefix | sed 's#/#\\\/#g')
BREW_ARRAY=("5.6","7.0","7.1","7.2")
PHP_ARRAY=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
PHP_INSTALLED_ARRAY=()
PHP_VERSION="php@$1"
PROFILE="/Users/prm/.zshrc"
# Has the user submitted a version required
@petemcw
petemcw / sphp
Created October 15, 2019 20:10
Simple script for changing Homebrew installed PHP versions
#!/usr/bin/env bash
################################################################################
#
# MacOS Homebrew-based PHP version switcher.
#
################################################################################
# Define read-only script variables
# -------------------------------------------------------------------------------
declare -r SPHP_BREW_PREFIX="$(brew --prefix | sed 's#/#\\\/#g')"
@petemcw
petemcw / 2.2.10.patch
Created October 18, 2019 14:44
Template patch for Magento Open Source 2.2.10
--- vendor/magento/module-backup/view/adminhtml/templates/backup//list.phtml 2019-09-19 15:52:44.000000000 -0500
+++ vendor/magento/module-backup/view/adminhtml/templates/backup//list.phtml 2019-10-17 17:37:00.000000000 -0500
@@ -7,4 +7,4 @@
<?= $block->getChildHtml('grid') ?>
<?= $block->getGridHtml() ?>
<?= $block->getDialogsHtml() ?>
-<?php
+
--- vendor/magento/module-bundle/view/base/templates/product/price/selection/amount.phtml 2019-09-19 15:52:44.000000000 -0500