Skip to content

Instantly share code, notes, and snippets.

View JosephMaxwell's full-sized avatar
🇺🇸
Working.

Joseph Maxwell JosephMaxwell

🇺🇸
Working.
View GitHub Profile
@JosephMaxwell
JosephMaxwell / system.xml
Created January 29, 2022 22:55
Full menu of options available in system.xml
<config>
<system>
<!--You have a CHOICE of the next 2 items at this level-->
<tab id="string" translate="string" sortOrder="1.5E2" class="string">
<label>string</label>
</tab>
<section id="string" translate="string" type="string" sortOrder="1.5E2" showInDefault="3" showInStore="3" showInWebsite="3" canRestore="3" advanced="false" extends="string">
<!--You have a CHOICE of the next 7 items at this level-->
<label>string</label>
<class>string</class>
@JosephMaxwell
JosephMaxwell / env.php
Created October 11, 2021 15:35
Art of Ecommerce Debugging Course Configuration
<?php
return [
'backend' => [
'frontName' => 'backend'
],
'remote_storage' => [
'driver' => 'file'
],
'queue' => [
'consumers_wait_for_messages' => 1,
@JosephMaxwell
JosephMaxwell / simple_product.php
Created August 4, 2021 13:49
Fast Simple Product
<?php
declare(strict_types=1);
/**
* @by SwiftOtter, Inc., 2019/10/24
* @website https://swiftotter.com
**/
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
@JosephMaxwell
JosephMaxwell / magento-object-manager-quick-fix-log.md
Created July 22, 2021 15:49
Quickly get the stack trace using Magento's Object Manager (hotfix)

This is NOT a best practice and is ONLY for an emergency situation. However, it is good to use the LoggerInterface throughout your code and add generous parameters to the array.

// Generate an exception so we can get the stack trace.
// We could use debug_backtrace, but it's easy to arguments and thus take the site down.
$ex = new Exception();

// Log it out. Don't forget the critically-helpful parameters array. Put anything
// and everything here.
@JosephMaxwell
JosephMaxwell / valetplus
Created July 14, 2018 00:21
phpinfo for valet+
PHP logo
PHP Version 7.1.19
System Darwin Josephs-MacBook-Pro-2.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
Build Date Jun 25 2018 10:40:43
Configure Command './configure' '--prefix=/usr/local/Cellar/php@7.1/7.1.19' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/7.1' '--with-config-file-path=/usr/local/etc/php/7.1' '--with-config-file-scan-dir=/usr/local/etc/php/7.1/conf.d' '--with-pear=/usr/local/Cellar/php@7.1/7.1.19/share/php@7.1/pear' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-dtrace' '--enable-exif' '--enable-ftp' '--enable-fpm' '--enable-intl' '--enable-mbregex' '--enable-mbstring' '--enable-mysqlnd' '--enable-opcache-file' '--enable-pcntl' '--enable-phpdbg' '--enable-phpdbg-webhelper' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-apxs2=/usr/local/opt/httpd/bin/apxs' '--with-bz2' '--with-fpm-us
@JosephMaxwell
JosephMaxwell / config.yaml
Created April 18, 2018 14:09
config.yaml
configuration:
compress-output: true
pipelines:
default:
- name: global-commands
actions:
- name: m2-clear-customers
sort: 50
- name: m2-clear-orders
@JosephMaxwell
JosephMaxwell / script.sql
Created November 7, 2017 22:03
Finding matching Row IDs in the entity tables (EE)
SELECT "Value ID", "Attribute ID", "Store ID", "Row ID", "Value", "Value ID", "Attribute ID", "Store ID", "Row ID", "Value"
UNION ALL
SELECT 0, 0, 0, 0, "TEXT TABLE" as value, 0, 0, 0, 0, ""
UNION ALL
SELECT * FROM catalog_product_entity_text `store0` INNER JOIN catalog_product_entity_text `store1` ON `store1`.attribute_id = `store0`.attribute_id AND `store0`.row_id = `store1`.row_id AND `store1`.store_id = 1 WHERE `store0`.store_id = 0 AND `store0`.value != `store1`.value
UNION ALL
SELECT 0, 0, 0, 0, "INT TABLE" as value, 0, 0, 0, 0, ""
UNION ALL
SELECT * FROM catalog_product_entity_int `store0` INNER JOIN catalog_product_entity_int `store1` ON `store1`.attribute_id = `store0`.attribute_id AND `store0`.row_id = `store1`.row_id AND `store1`.store_id = 1 WHERE `store0`.store_id = 0 AND `store0`.value != `store1`.value
UNION ALL
@JosephMaxwell
JosephMaxwell / Magento2-BuildSub.sh
Created August 26, 2017 20:05
Magento 2 Build Environment Configuration
sudo yum install -y java-1.8.0-openjdk.x86_64
sudo /usr/sbin/alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
sudo /usr/sbin/alternatives --set javac /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/javac
sudo yum remove java-1.7
wget https://mirror.webtatic.com/yum/el6/latest.rpm
# Install webtatic repo
sudo yum install -y latest.rpm
@JosephMaxwell
JosephMaxwell / jenkins.template
Last active January 27, 2022 00:38
Jenkins CloudFormation Template (more information and tutorial videos at https://swiftotter.com/technical/running-jenkins-on-amazon-ec2-with-cloudformation)
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Launches a Jenkins server.",
"Parameters": {
"InstanceType": {
"Description": "EC2 instance type",
"Type": "String",
"Default": "t2.small",
"AllowedValues": [
"t1.micro",
@JosephMaxwell
JosephMaxwell / jenkins.json
Created August 12, 2016 12:34
CloudFormation Template for Jenkins on EC2
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Launches a Jenkins server.",
"Parameters" : {
"InstanceType" : {
"Description" : "EC2 instance type",
"Type" : "String",
"Default" : "t2.small",