Skip to content

Instantly share code, notes, and snippets.

Alejandro Cargnelutti alecarg

  • London, UK
Block or report user

Report or block alecarg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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) {
@alecarg
alecarg / m2-mixin-uicomponent.js
Last active Aug 20, 2019
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 / 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 "$@"
You can’t perform that action at this time.