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 / 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 / EE-TO-CE_Downgrade
Created March 9, 2015 02:10
Downgrade script for magento EE to CE
#!/bin/bash
#first param = db user, second param = db name
rm -rf app/code/core/Enterprise
rm -rf downloader/template/enterprise
rm -rf app/design/install/default/enterprise
rm -rf app/design/frontend/enterprise
rm -rf app/design/adminhtml/default/default/layout/enterprise
rm -rf app/design/adminhtml/default/default/template/enterprise
@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": {
<?php
declare(strict_types=1);
namespace Enjo\Pure\Ui\DataProvider\Product\Form\Modifier;
use Magento\Ui\Component\Container;
use Magento\Ui\Component\DynamicRows;
use Magento\Ui\Component\Form\Field;
use Magento\Ui\Component\Form\Fieldset;
use Magento\Ui\Component\Form\Element\Textarea;
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Run with: vagrant up --provider=docker
# to get a dns entry for the docker machines use DNSGUARD
# docker run -d -v /var/run/docker.sock:/var/run/docker.sock --restart always --name dnsdockmain -p 172.17.42.1:53:53/udp tonistiigi/dnsdock -domain=".local.com" -nameserver="192.168.50.20:53"
#
# common usage: vagrant --name=magento up --provider=docker
require 'getoptlong'
@ProxiBlue
ProxiBlue / declinedTransactions.php
Created November 6, 2018 03:34
Count Declined Payments From exception.log per day
<?php
/**
* Just a rough script to parse the exception log, find all entries that match the Declined string, and group
* them by day.
* This effectively shows a major increase in a sites number of declind transactions, for which scripting was the cause
* Setup of reCapctha at checkout stopped this issue
*
* Log example:
* 2017-06-22T15:17:06+00:00 ERR (3):
* exception 'Mage_Core_Exception' with message 'Declined: 15005-This transaction cannot be processed.' in public_html/app/Mage.php:603
$('form input:text').each(function(index, elem) {
var eId = $(elem).attr('id');
var label = null;
if (eId && (label = $(elem).parents('form').find('label[for='+eId.replace(':', '\\:')+']')).length === 1) {
$(elem).attr('placeholder', $(label).html().replace(/<\/?[^>]+(>|$)/g, ""));
@ProxiBlue
ProxiBlue / gist:e797f00735fbf0a06ddb55e837b9140a
Last active February 8, 2018 01:55
Record sensibo pod temperature. added in calculation for Feel like as used by sensibo Climate React and different Apparent calculation to allow comparisons
<?php
$fp = fopen('/tmp/temp_monitor.csv', 'a');
$curl = curl_init('https://home.sensibo.com/api/v2/pods/jFFZuNq6/measurements?apiKey=MxeORFfanBUJnCbd3HLmssEYJF2WbO');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
if ($curl_response === false) {
$info = curl_getinfo($curl);
curl_close($curl);
die('error occurred during curl exec. Additional info: ' . var_export($info));
}
@ProxiBlue
ProxiBlue / gist:fdf28f9bf8b678e9aa30c475d681f974
Created January 27, 2018 09:11
ReCaptcha Email a friend template changes diff
diff --git a/app/design/frontend/default/theme567/template/sendfriend/send.phtml b/app/design/frontend/default/theme567/template/sendfriend/send.phtml
index 14432118..be6096dc 100644
--- a/app/design/frontend/default/theme567/template/sendfriend/send.phtml
+++ b/app/design/frontend/default/theme567/template/sendfriend/send.phtml
@@ -32,8 +32,13 @@
?>
<script type="text/javascript">
//<![CDATA[
- i=0;
- var recipCount = 1;
@ProxiBlue
ProxiBlue / gist:bff88b184c9c0e44997ff6ae05468b01
Created January 27, 2018 09:10
ReCaptcha Email to a friend template with changes
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php