Skip to content

Instantly share code, notes, and snippets.

View amenk's full-sized avatar

Alexander Menk amenk

View GitHub Profile
@amenk
amenk / README.md
Created October 15, 2023 15:02
Chrome Bug 1492811 Repro
@amenk
amenk / mysql8.patch
Created November 5, 2022 17:55
Contao 3.5.40 MySQL 8 Patch
diff --git a/public/system/modules/core/drivers/DC_Table.php b/public/system/modules/core/drivers/DC_Table.php
index 5f099f9..520d326 100644
--- a/public/system/modules/core/drivers/DC_Table.php
+++ b/public/system/modules/core/drivers/DC_Table.php
@@ -5459,7 +5459,7 @@ class DC_Table extends \DataContainer implements \listable, \editable
$arrProcedure[] = "id IN(" . implode(',', array_map('\intval', $GLOBALS['TL_DCA'][$table]['list']['sorting']['root'])) . ")";
}
- $objFields = $this->Database->prepare("SELECT DISTINCT " . $what . " FROM " . $this->strTable . ((is_array($arrProcedure) && strlen($arrProcedure[0])) ? ' WHERE ' . implode(' AND ', $arrProcedure) : ''))
+ $objFields = $this->Database->prepare("SELECT DISTINCT " . \Database::quoteIdentifier($what) . " FROM " . $this->strTable . ((is_array($arrProcedure) && strlen($arrProcedure[0])) ? ' WHERE ' . implode(' AND ', $arrProcedure) : ''))
@amenk
amenk / RoboFile.php
Last active January 29, 2021 12:29
Boilerplate Manager RoboFile (for use with robo.li Task Runner)
<?php
use Symfony\Component\Console\Question\ChoiceQuestion;
class RoboFile extends \Robo\Tasks
{
const VERSION_FILE = '.boilerplate-template-version';
var $currentGitVersion = null;
@amenk
amenk / performance-xdebug.md
Last active January 14, 2020 08:05
XDebug Performance Problem with Magento 2.3

Setup

PHP 7.1 Magento 2.3.2-p2

bin/magento:

global $mageStart;
$mageStart = microtime(true);
@amenk
amenk / query.sql
Created September 4, 2019 13:45
Find Magento 2 database sessions of a specific user ID
# user ID = 99 (if the ID is longer, adapat the s:2 part to the length
select FROM_UNIXTIME(session_expires), FROM_BASE64(session_data) as sd
from session
having sd like "%customer_id"";s:2:""99""%"
order by session_expires desc;
@amenk
amenk / snippets.php
Last active August 7, 2019 14:54
Magento 2 n98-magerun2 dev:console snippets
// Startup: n98-magerun2 dev:console
// Dump a product's data by SKU
$sku = "thisIsTheSKU"; $di->get('Magento\Catalog\Model\ProductRepository')->get($sku)->debug();
@amenk
amenk / composer.json
Created May 24, 2019 13:53
Premium Contao Theme Installation via Composer (WIP)
{
"name": "contao/managed-edition",
"type": "project",
"description": "Contao Open Source CMS",
"license": "LGPL-3.0-or-later",
"authors": [
{
"name": "Leo Feyer",
"homepage": "https://github.com/leofeyer"
}
@amenk
amenk / _catalog.scss
Created September 28, 2018 09:10
Smile SA ElasticSearch to SASS
// /**
// * DISCLAIMER
// *
// * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
// * versions in the future.
// *
// *
// * $category Smile
// * $package Smile\ElasticsuiteCatalog
// * $author Aurelien FOUCRET <aurelien.foucret$smile@mixin fr>
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "426e9bfece9007e8492824a8ad404e85",
"packages": [
{
"name": "dnoegel/php-xdg-base-dir",
@amenk
amenk / README.md
Created January 29, 2018 15:07
How To Apply a Magento 2 Patch to your project
  • Find the commit a GitHub
  • Add .patch to the URL
  • Require vaimo/composer-patches
  • Add an entry like the above, with path-removal-level 5, to the composer.json