Skip to content

Instantly share code, notes, and snippets.

View alecarg's full-sized avatar

Alejandro Cargnelutti alecarg

View GitHub Profile
{"lastUpload":"2022-03-15T13:52:46.456Z","extensionVersion":"v3.4.3"}
@alecarg
alecarg / mvr.sh
Created October 30, 2019 15:34
mv recursively (to avoid files not being moved if folders don't exist)
#!/bin/bash
# mv.sh
dir="$2"
tmp="$2"; tmp="${tmp: -1}"
[ "$tmp" != "/" ] && dir="$(dirname "$2")"
[ -a "$dir" ] ||
mkdir -p "$dir" &&
mv "$@"
@alecarg
alecarg / m2-mixin-uicomponent.js
Last active February 26, 2021 09:17
Magento 2 mixins (extend/override for UIComponents)
/*
* Magento 2 mixins for js files that return an UIComponent
* (based on https://alanstorm.com/the-curious-case-of-magento-2-mixins/)
* (for files that return an object literal: https://gist.github.com/alecarg/71a28b6d0ce2c3b7073481cc52fe1e23)
* (for files that return a function: )
*/
define([
], function () {
'use strict';
@alecarg
alecarg / m2-mixin-object-literal.js
Last active October 4, 2024 10:00
Magento 2 mixins (extend/override for object literals)
/*
* Magento 2 mixins for js files that return an object literal
* (based on https://alanstorm.com/the-curious-case-of-magento-2-mixins/)
* (for files that return an UIComponent: https://gist.github.com/alecarg/ed0516132e9c8a31c66f13fbccd292cf)
* (for files that return a function: )
*/
define([
'mage/utils/wrapper'
], function (wrapper) {