Skip to content

Instantly share code, notes, and snippets.

View oneNevan's full-sized avatar

Ivan Nemets oneNevan

View GitHub Profile
@martinboy
martinboy / magento2-mixin-on-mixin.md
Last active September 5, 2023 12:30
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)

Task

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

Solution

  • Declare your mixin in custom theme app/design/frontend/[Vendor]/[theme]/Magento_Catalog/requirejs-config.js file and associate it with the initial widget
@sjb9774
sjb9774 / elasticsearch.sh
Last active February 25, 2021 21:11
ElasticSearch CURL Commands
ES_HOST='elasticsearch-host' # for example 127.0.0.1
ES_PORT='elasticsearch-port' # default 9200
# get indices
curl $ES_HOST:$ES_PORT/_cat/indices
ES_INDEX='index-name'
# get first 5 results from empty
curl $ES_HOST:$ES_PORT/$ES_INDEX/_search | jq .
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active December 7, 2023 14:14
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@erikhansen
erikhansen / sync_prod_to_stage.sh
Last active November 11, 2022 23:31
Magento 2 script to push DB and `pub/media` changes from prod>stage
#!/bin/bash
# stop on errors
set -e
# turn on debugging if you're running into issues
#set -x
# Static variables
ENVIRONMENT=$1
RED='\033[0;31m'
NC='\033[0m' # No Color
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE