Skip to content

Instantly share code, notes, and snippets.

View kweij's full-sized avatar

Klaas van der Weij kweij

  • iO
  • Eindhoven
View GitHub Profile
@kweij
kweij / magento2_log_anywhere.php
Last active January 8, 2024 10:07
Magento 2 quick logging snippet
\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->critical(\print_r([
'value' => $value,
], true));
@kweij
kweij / layout_test_text_block.xml
Last active June 13, 2023 09:56
Magento test text block
<?xml version="1.0"?>
<!--
/**
* See LICENSE.txt for copyright and license details.
* @license proprietary
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
@kweij
kweij / bootstrap-modal-fix-ios-background-scrolling.js
Created October 1, 2018 12:58
JavaScript-only fix for the background scrolling in Bootstrap modals on iOS (Safari)
let previousScrollY = 0;
$(document).on('show.bs.modal', () => {
previousScrollY = window.scrollY;
$('html').addClass('modal-open').css({
marginTop: -previousScrollY,
overflow: 'hidden',
left: 0,
right: 0,
top: 0,