Skip to content

Instantly share code, notes, and snippets.

View maderlock's full-sized avatar

Rob Egginton maderlock

View GitHub Profile
@maderlock
maderlock / C3\Utility\DuplicateDatabase.php
Created September 2, 2016 11:03
PHP class to duplicate database
<?php
namespace C3\Utility;
use Monolog\Logger;
/**
* Class DuplicateDatabase
*
* @package C3\Utility
@maderlock
maderlock / Observer_AfterOrderInvoiceAddresses.php
Created September 6, 2016 16:09
Temporary fix for Magento 2 bug where invoices for PayPal orders do not have address information attached. This mainly shows up in the grid. See https://github.com/magento/magento2/issues/6438
<?php
namespace C3\Magento2Fixes\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Sales\Model\Order\InvoiceFactory;
class AfterOrderInvoiceAddresses implements ObserverInterface
{
@maderlock
maderlock / amcaptcha.phtml
Created September 8, 2017 10:41
Allowing multiple forms to be recaptcha'ed with Amasty Invisible Google ReCaptcha for Magento 2
<?php
/**
* @author Amasty Team
* @copyright Copyright (c) 2017 Amasty (https://www.amasty.com)
* @package Amasty_InvisibleCaptcha
*/
?>
<?php
/**
*
@maderlock
maderlock / map_size.js
Created November 16, 2020 19:55
Roll20 API script to contract and expand maps
myGetCleanImagesrc = function (imgsrc) {
var parts = imgsrc.match(/(.*\/images\/.*)(thumb|med|original|max)([^?]*)(\?[^?]+)?$/);
if(parts) {
return parts[1]+'thumb'+parts[3]+(parts[4]?parts[4]:`?${Math.round(Math.random()*9999999)}`);
}
return;
};
// When a map changes vertical location, resize
const x_threshold = 800;
on("change:graphic:top", function(obj, prev) {