Skip to content

Instantly share code, notes, and snippets.

Avatar

Alejandro Cargnelutti alecarg

  • London, UK
View GitHub Profile
View cloudSettings
{"lastUpload":"2020-08-11T13:10:26.871Z","extensionVersion":"v3.4.3"}
@alecarg
alecarg / mvr.sh
Created Oct 30, 2019
mv recursively (to avoid files not being moved if folders don't exist)
View mvr.sh
#!/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 Jun 24, 2020
Magento 2 mixins (extend/override for UIComponents)
View m2-mixin-uicomponent.js
/*
* 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 Aug 20, 2019
Magento 2 mixins (extend/override for object literals)
View m2-mixin-object-literal.js
/*
* 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) {
You can’t perform that action at this time.