Skip to content

Instantly share code, notes, and snippets.

View aleron75's full-sized avatar

Alessandro Ronchi aleron75

View GitHub Profile
@aleron75
aleron75 / mage-os-pagebuilder-explanation.md
Last active October 19, 2025 11:20 — forked from dadolun95/mage-os-pagebuilder-explanation.md
Mage-OS Page Builder Widget component explanation

Why we need this module and that kind of feature?

Mage-OS PageBuilder Widget module (part of the Mage-OS release since 2.0 version) allows the user to specify CMS widgets and the related configurations inside a dedicated PageBuilder component named "CMS Widget". As for all PageBuilder components, this component is draggable and can be placed inside other components. The main feature of this module is the ability to configure widgets and see a preview on the PageBuilder.

In terms of developer experience, this module is an enhancement that eliminates the need to develop PageBuilder dedicated components and understand all the stuff behind it (UI Components, PageBuilder inheritance logic, preview vs actual frontend representation).

The main goal of the module is to simplify the development, customization and usage of PageBuilder UI components, relying entirely on CMS widgets (that are pretty easy to use).

@aleron75
aleron75 / env.php
Last active April 15, 2020 13:29
Admin session config values for Magento 2 local development environment
<?php
// app/etc/env.php
return [
// ...
'system' => [
'default' => [
'admin' => [
'security' => [
'session_lifetime' => 31536000,
'password_reset_protection_type' => 0,
@aleron75
aleron75 / Config.php
Last active August 8, 2017 10:39
Set global config value in Magento 1
Mage::getConfig()->saveConfig(Bitbull_Multiwarehouse_Helper_Data::XML_PATH_GENERAL_ACTIVE, 1);
Mage::getConfig()->cleanCache();
@aleron75
aleron75 / 0_reuse_code.js
Created September 22, 2016 12:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aleron75
aleron75 / getip.sh
Created September 17, 2016 09:17
Get IP address on local network interface
#!/bin/bash
ip addr show eno1 | grep -oPi 'inet \K[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
@aleron75
aleron75 / setup_db_status.sh
Created August 12, 2016 12:33
Bash script to get different exit codes upon the bin/magento setup:db:status command
#!/bin/bash
# use --no-ansi to avoid color characters
message=$(bin/magento setup:db:status --no-ansi)
if [[ ${message:0:3} == "All" ]];
then
exit 0 # 0 not required being default exit code; used for clarity
else
exit 1
fi
@aleron75
aleron75 / product_count.php
Created June 10, 2016 21:03
Magento 2 - get product collection count via runtime
<?php
try {
require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
echo $e->getMessage() . PHP_EOL;
exit(1);
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
@aleron75
aleron75 / composersize.sh
Last active January 17, 2018 19:08
Shell script to "composerize" a Magento module
#!/bin/bash
function help {
echo "Arguments:"
echo " package name"
echo " package description"
}
dir=$(pwd)
@aleron75
aleron75 / check_xml.sh
Created January 17, 2016 09:31
Validate all config.xml files to spot XML syntax errors
find . -type f -name 'config.xml' -exec xmllint --noout {} \;
@aleron75
aleron75 / .bashrc
Created November 19, 2015 13:43
XEBUG on/off alias
alias xdebugon='export XDEBUG_CONFIG="idekey=phpstorm-xdebug" && sudo mv /etc/php5/mods-available/xdebug.ini.no /etc/php5/mods-available/xdebug.ini && sudo service apache2 restart'
alias xdebugoff='sudo mv /etc/php5/mods-available/xdebug.ini /etc/php5/mods-available/xdebug.ini.no && sudo service apache2 restart'