Skip to content

Instantly share code, notes, and snippets.

View ProxiBlue's full-sized avatar
🏠
Working from home

Lucas van Staden ProxiBlue

🏠
Working from home
View GitHub Profile
@ProxiBlue
ProxiBlue / repmanfix
Created March 1, 2024 08:12
repman packages fix from 404
#!/bin/env bash
# Requires HTTPie and JQ
ORG_NAME='xxxxxx'
API_KEY='xxxxxx'
SLEEP_S=0.5
# End of variables that need to change
package_url="https://app.repman.io/api/organization/${ORG_NAME}/package"
@ProxiBlue
ProxiBlue / n98-magerun2.yaml
Created May 2, 2022 05:44
n98-magerun2 more extensive list of required php modules
commands:
N98\Magento\Command\System\CheckCommand:
php:
required-extensions:
- bcmath
- ctype
- dom
- fileinfo
- json
- mbstring
@ProxiBlue
ProxiBlue / gist:ad1bc6db0f74e4494f92f94d04423b4b
Last active January 26, 2022 22:06
cypress random test from sitemap.xml that old site and new site match data
Add the following to plugins/index.js
module.exports = (on, config) => {
on('task', {
log (message) {
console.log(message)
return null
}
})
}
@ProxiBlue
ProxiBlue / gist:0106c7fa0f2fd24b613f0e61c0ac7c90
Last active July 28, 2021 03:21
Enable paypal express and paypal payflow pro at same time magento 2
Magento 2 Paypal has a weird limit that you cannot enable Paypal Expresss checkout and other payment methods
(like paypal payflowpro) at the same time.
Sure, Paypal Payflow has the option to enable express, but that is not teh same thing.
The 'express' in paypal payflow pro are direct checkout buttons on product and cart pages, which directly
make a purchase to Paypal, it does NOT add a payment method to select in checkout.
A bit of a hack to enable them both on checkout, so as selectable payment options is to lock the express
values to enbal in env.php
@ProxiBlue
ProxiBlue / buddy.pipeline.sniffs
Created January 27, 2021 01:58
pipeline php sniffs
rm composer.json
rm composer.lock
composer require magento-ecg/coding-standard mandrill/mandrill
[ -d "code_sniff" ] || mkdir code_sniff
phpcs --config-set ignore_warnings_on_exit 1
phpcs --config-set ignore_errors_on_exit 1
phpcs --report-file=./code_sniff/sniff.txt --standard=./vendor/magento-ecg/coding-standard/Ecg ${PATH_TO_SNIFF}
php_cwd=`php << 'EOF'
<?php
require __DIR__ . '/vendor/autoload.php';
@ProxiBlue
ProxiBlue / maldet.pipeline.script
Created January 26, 2021 10:58
Using maldet inside a pipeline deploy
#buddy starts in the working dir
SCANDIR=$(pwd)
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzf maldetect-current.tar.gz
cd maldetect-1.6.4
/bin/bash ./install.sh
#make a fake vi to just echo out the report
echo '#!/bin/bash' >/usr/bin/vi
echo 'echo $1' >>/usr/bin/vi
chmod +x /usr/bin/vi
@ProxiBlue
ProxiBlue / set-config.php
Last active December 28, 2020 09:01
move mageno 2 locked config back to database
#!/usr/bin/env php
## steps
#
# fix where app:config:dump was run, adn value sin magento db is outof sync (so they ONLy exist in the dumped configs)
#
# Copy your app/etc/config.php (or app/etc/env.php) to bin folder
# delete from the app/etc/config.php (or env.php) file the values you want to re-import TO DB
# run bin/magento app:config:import (to process the changes you just made)
# run this script: ./bin/set-config.php --config config.php (or env.php)
<?php
namespace ProxiBlue\Shell\Console\Command;
use Magento\Setup\Exception;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
@ProxiBlue
ProxiBlue / qb-sdk-class-exists-patch.txt
Created May 12, 2020 13:17
quickbooks api class exists noise log patch
diff --git a/src/Core/Http/Serialization/XmlObjectSerializer.php b/src/Core/Http/Serialization/XmlObjectSerializer.php
index 1c7d865..4a4a3cc 100644
--- a/src/Core/Http/Serialization/XmlObjectSerializer.php
+++ b/src/Core/Http/Serialization/XmlObjectSerializer.php
@@ -83,9 +83,9 @@ class XmlObjectSerializer extends IEntitySerializer
private static function PhpObjFromXml($className, $xmlStr)
{
$className = trim($className);
- if (class_exists($className, CoreConstants::USE_AUTOLOADER)) {
+ if (@class_exists($className, CoreConstants::USE_AUTOLOADER)) {
@ProxiBlue
ProxiBlue / api_local.json
Last active October 20, 2019 13:36
local.json used for vagrant + magento + vuestorefront
{
"server": {
"host": "localhost",
"port": 8080,
"searchEngine": "elasticsearch"
},
"orders": {
"useServerQueue": false
},
"catalog": {