Skip to content

Instantly share code, notes, and snippets.

View khnaim's full-sized avatar

Khadija NAIM khnaim

View GitHub Profile
@khnaim
khnaim / mysql-docker.sh
Created September 10, 2021 07:32 — forked from spalladino/mysql-docker.sh
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
@khnaim
khnaim / or-example.php
Created August 18, 2020 13:22 — forked from Vinai/or-example.php
SearchCriteria OR Example for Magento 2
<?php
declare(strict_types = 1);
namespace Training5\VendorRepository\Controller\Test;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Api\Filter;
use Magento\Framework\Api\FilterBuilder;

Magento Snippets

Add Attribute Group and Attributes to Attribute Sets

In an install script, you can follow the below example:

<?php
/**
 * Pan_JewelryDesigner Extension