Skip to content

Instantly share code, notes, and snippets.

View Marko-M's full-sized avatar

Marko Martinović Marko-M

View GitHub Profile
From 063359089809f7da4a4f6a95b4523135e6c4711f Mon Sep 17 00:00:00 2001
From: Luke Rodgers <lr@amp.co>
Date: Thu, 9 Jun 2022 11:58:46 +0100
Subject: [PATCH 1/4] Fix Test Logger monolog compatability
# System info
- Magento 2.4.4
- PHP 8.1
# To reproduce
--- App/DeploymentConfig.php 2022-03-08 00:52:02.000000000 +0000
+++ App/DeploymentConfig.php 2022-06-20 19:45:21.192956000 +0000
@@ -35,14 +35,14 @@
*
* @var array
*/
- private $data;
+ private $data = [];
/**
@Marko-M
Marko-M / gist:5cdfecd4229a0c22178e8103089fc4d7
Created February 14, 2022 14:07
MySQL production environment
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1898052
Server version: 10.2.31-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
@Marko-M
Marko-M / gist:fb49dfacdc4c15cf84e3b76fcff3433b
Created February 14, 2022 14:05
MySQL local development environment
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 209
Server version: 5.7.33-36 Percona Server (GPL), Release 36, Revision 7e403c5
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
From 597b769f5918e11b58dc15ae7cc407477ee2c695 Mon Sep 17 00:00:00 2001
From: Sergey Nezbritskiy <sergey.nezbritskiy@gmail.com>
Date: Sun, 15 Aug 2021 17:55:34 +0300
Subject: [PATCH 1/7] ISSUE-33802: ensure that deployment config will reload
its data, if the key was not found
---
.../Framework/App/DeploymentConfig.php | 33 +++++++---
.../App/Test/Unit/DeploymentConfigTest.php | 64 +++++++++++--------
2 files changed, 60 insertions(+), 37 deletions(-)
/**
* DevGenii #8: Dummy Postpay JavaScript
*/
define(function () {
window.Postpay = {
renderElement: function (el) {
el.innerHTML = 'Postpay!'
},
hideElement: function (el) {
el.style.display = 'none';
@Marko-M
Marko-M / gist:823ea02de09b8279aa36f6d26bf48688
Created July 2, 2018 14:07
SUPEE-10752 for Magento CE 1.9.3.8
marko@marko-work ~/Desktop/magento $ grep -A 10 'function getVersionInfo' < app/Mage.php
public static function getVersionInfo()
{
return array(
'major' => '1',
'minor' => '9',
'revision' => '3',
'patch' => '8',
'stability' => '',
'number' => '',
@Marko-M
Marko-M / magento_bundle_product_type_price_indexer.sql
Last active March 28, 2018 20:46
Magento Bundle Product Type Price Indexer
INSERT INTO `catalog_product_index_price_bundle_idx`
SELECT `e`.`entity_id`,
`cg`.`customer_group_id`,
`cw`.`website_id`,
IF(IF(Ifnull(tas_tax_class_id.value_id, -1) > 0, tas_tax_class_id.value, tad_tax_class_id.value) IS NOT NULL, IF(Ifnull(tas_tax_class_id.value_id, -1) > 0, tas_tax_class_id.value, tad_tax_class_id.value), 0) AS `tax_class_id`,
1 AS `price_type`,
IF(IF(IF(Ifnull(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) IS NULL, 1, IF(IF(Ifnull(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) <= cwd.website_date, 1, 0)) > 0
AND IF(IF(Ifnull(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value) IS NUL
@Marko-M
Marko-M / nginx_access.log
Last active November 23, 2017 12:22
/checkout/cart/add/ DoS
123.123.123.123 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/142/form_key/CSLLfXodh1AqB5KK/ HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21"
234.234.234.234 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/8086/form_key/CSLLfXodh1AqB5KK HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21"
123.123.123.123 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/3734/form_key/CSLLfXodh1AqB5KK/ HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21"
123.123.123.123 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/8086/form_key/CSLLfXodh1AqB5KK HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) Appl
@Marko-M
Marko-M / customer-install-0.1.0.php
Created February 6, 2017 09:03 — forked from jzahedieh/customer-install-0.1.0.php
Magento Customer Attribute Setup
<?php
/* @var $installer Mage_Customer_Model_Resource_Setup */
$installer = Mage::getResourceModel('customer/setup','customer_setup');
$installer->startSetup();
if (!$installer->getAttributeId('customer', 'attribute_name')) {
$installer->addAttribute('customer', 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
/** Standard values defined @see Mage_Eav_Model_Entity_Setup::_prepareValues() */
'label' => 'Label', // eav_attribute.frontend_label admin input label
'backend' => 'module/class_name', // eav_attribute.backend_model backend class (module/class_name format)