Skip to content

Instantly share code, notes, and snippets.

View onlinebizsoft's full-sized avatar

onlinebizsoft

View GitHub Profile
@onlinebizsoft
onlinebizsoft / what-forces-layout.md
Created April 30, 2023 12:39 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@onlinebizsoft
onlinebizsoft / Coding Standard.md
Created August 9, 2018 11:19
PHP, JS, CSS Coding Standard

Coding Standard

Filenames

  • Filenames are case sensitive
  • Allowed charset: a-zA-Z0-9-.
  • Spaces are not allowed

PHP

<script id="some-template" type="text/x-magento-template">
<div class="wrapper">
<input id="<%- data.id %>" name="<%- data.name %>" placeholder="<%- data.placeholder %>" />
</div>
</script>
<?php
namespace Ashsmith\Blog\Ui\Component\Listing\Column;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\UrlInterface;
<?php
namespace OpenTechiz\Blog\Model\Post\Source;
class IsActive implements \Magento\Framework\Data\OptionSourceInterface
{
/**
* @var \OpenTechiz\Blog\Model\Post
*/
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="OpenTechiz\Blog\Api\Data\PostInterface" type="OpenTechiz\Blog\Model\Post" />
<virtualType name="BlogGirdFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
<arguments>
<argument name="appliers" xsi:type="array">
<item name="regular" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item>
<item name="fulltext" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item>
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">