Skip to content

Instantly share code, notes, and snippets.

martinboy /
Last active Sep 21, 2021
Magento 2: Extend mixin with mixin in custom theme

Input data

  • initial widget Magento_Theme/js/view/breadcrumbs (vendor/magento/module-theme/view/frontend/web/js/view/breadcrumbs.js)
  • native mixin that extends this widget: Magento_Catalog/js/product/breadcrumbs (vendor/magento/module-catalog/view/frontend/web/js/product/breadcrumbs.js)


Extend methods of the mixin Magento_Catalog/js/product/breadcrumbs


  • Declare your mixin in custom theme app/design/frontend/[Vendor]/[theme]/Magento_Catalog/requirejs-config.js file and associate it with the initial widget
View gist:d98cac53fdfd1a7176609e9687345be7
I have just discovered a great feature of composer:
composer update --lock
It saves a lot of time when you merge branches with composer.lock file changes in both branches.
Just resolve conflict by applying --ours version of the file (or --theirs, it really doesn't matter) and then run
`composer update --lock `.
Composer will do all the dirty work for you and update composer.lock file according to composer.json changes
and install new packages. The rest of packages in composer are not changed.
martinboy /
Last active Apr 1, 2020
Magento: In case when you need to create a custom patch for any code which is in gitignore (for example modules in vendor/ directory)
  1. cd <magento_root>
  2. mkdir -p m2-hotfixes/tmp
  3. Copy original files
    cp --parents <path/to/yout/file1> <path/to/yout/file2> ... m2-hotfixes/tmp
    rsync -R <path/to/yout/file1> <path/to/yout/file2> ... m2-hotfixes/tmp
  4. cd m2-hotfixes/tmp
  5. git init && git add . && git commit -m "Initial commit"
  6. Make changes in files in m2-hotfixes/tmp directory
  7. git add . &amp;&amp; git commit -m "Fix something"
martinboy / debug_log.xml
Created Sep 10, 2018
Magenta 2 snippets: Custom debug log file
View debug_log.xml
<virtualType name="VirtualDebug" type="Magento\Framework\Logger\Handler\Base">
<argument name="fileName" xsi:type="string">/var/log/custom_error.log</argument>
<virtualType name="VirtualLogger" type="Magento\Framework\Logger\Monolog">
<argument name="handlers" xsi:type="array">
<item name="debug" xsi:type="object">VirtualDebug</item>
martinboy / m2_clear_order_customer_data.sql
Created Apr 21, 2017
Magento 2 clear order's and customer's data
View m2_clear_order_customer_data.sql
### QUOTE ###
DELETE FROM `quote`;
FROM `quote_id_mask` a1
LEFT JOIN quote a2 ON a1.quote_id = a2.entity_id
WHERE a2.entity_id IS NULL ;
FROM `quote_address` a1
martinboy /
Created Jan 21, 2017
Create a directory structure and some files for an ansible role
# Create a directory structure and some files
# for an ansible role
# Defaults
# Check input params
if [ -z "$1" ]; then
echo "Missing argument role name"
martinboy /
Last active Apr 29, 2019
Add all symlinks to a .gitignore file that aren't in there already.
martinboy /
Last active Jul 14, 2016
Bulk remove files from Slack for the period
# source
import requests
import json
import calendar
from datetime import datetime, timedelta
### Input vars ###
martinboy /
Last active Jul 11, 2016
Ansible Quickes