This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() {const samjuk_css_table = 'samjuk-table';const samjuk_css_table_highlight = 'samjuk_css_table_highlight';document.head.insertAdjacentHTML("beforeend", ` <style> .${samjuk_css_table} th { cursor: pointer !important; } .${samjuk_css_table_highlight} { background: #fff0af !important; font-weight: bold !important; } </style>`);document.querySelectorAll('sp-tab[label="Commerce on-premises"], sp-tab[label="Commerce on Cloud"]').forEach(tab => { const panel = tab.parentElement.querySelector('#' + tab.getAttribute('aria-controls')); if (panel === null) { return false; } const table = panel.querySelector('table'); if (table === null) { return false; } table.classList.add(samjuk_css_table); const headers = table.querySelector('thead'); if (headers === null) { return false; } headers.addEventListener('click', (event) => { let version = event.target; Array.from(table.querySelectorAll(`.${samjuk_css_table_highlight}`)).forEach(highlight => { highlight.classList.remove(samjuk_css_table_highlight); }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# | |
# Lists the differences between the currently installed Schema and that parsed from db_schema.xml | |
# | |
use Magento\Framework\App\Bootstrap, Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; | |
require __DIR__ . '/app/bootstrap.php'; | |
error_reporting(E_ALL & ~E_NOTICE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Crontab: 0 *\/3 * * * /usr/bin/php /var/www/htdocs/z_missing_invoice_cron.php --commit | mail -s "MagentoStore: Stale Invoice Grid Refresh" email@domain.co.uk | |
**/ | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . '/app/bootstrap.php'; | |
error_reporting(E_ALL & ~E_NOTICE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: assert_magento_owner deploy css critical cache developer production | |
.DEFAULT_GOAL := help | |
# | |
# Variables | |
# | |
EXECUTER=$(shell whoami) | |
MAGE_OWNER=$(shell stat -c '%U' bin/magento) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# This script creates one big nginx config, squashing any includes into a single output. | |
# | |
import re | |
import glob | |
import nginxfmt | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Magento\Sales\Model\Order; | |
ini_set('display_errors', 1);ini_set('display_startup_errors', 1);error_reporting(E_ALL); | |
require __DIR__ . '/app/bootstrap.php'; | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fetch and count all Magento reports (fatal error) exception messages from stack traces. | |
find /var/www/vhosts/prod.site.com/htdocs/var/report -type f -exec python -m json.tool {} \; | grep -i '"0":' | awk -F\" '{print $4}' | sort | uniq -c | sort -h | |
// Delete reports over 30 days old | |
find /var/www/vhosts/prod.site.com/htdocs/var/report -mindepth 1 -maxdepth 1 -type f -mtime +30 -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# Monitor the disk space and send an email to $ADMIN, | |
# If the free space is less than the $ALERT threshold (default 90%). | |
# | |
# @Author: Sam James <sam@sdj.pw> | |
# @Requirements: Mail, Awk, Grep, df, | |
# | |
# ============= # | |
# CONFIGUARTION # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Handle removing any inventory reservation entries in Magento 2's Multi Source Inventory (MSI) system | |
* that belong to a order in final state (def: closed,canceled,complete). | |
* | |
* @maintainer: Sam James <sam@sdj.pw> | |
*/ | |
ini_set('display_errors', 1);ini_set('display_startup_errors', 1);error_reporting(E_ALL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- --------------------------------- | |
-- Restore a Magento 2 order from | |
-- a canceled state to processing. | |
-- --------------------------------- | |
START TRANSACTION; | |
SET @IID = '000028692'; | |
SET @OID = (SELECT entity_id FROM sales_order WHERE increment_id = @IID LIMIT 1); |
NewerOlder