Skip to content

Instantly share code, notes, and snippets.

View JesKingDev's full-sized avatar

Jessica King JesKingDev

View GitHub Profile
@SpencerRohan
SpencerRohan / WebsiteAndStoreCreator.php
Last active January 11, 2022 02:15 — forked from 0-Sony/WebsiteAndStoreCreator.php
Magento 2 : Create Programmatically Website/Store/StoreGroup
<?php
namespace XX\StoreBuilder\Setup;
/**
* Class InstallData
* @package XX\StoreBuilder\Setup
*/
use Magento\Framework\Event\ManagerInterface;
@KaiCMueller
KaiCMueller / array_merge_recursive_distinct.php
Created November 9, 2017 10:12
Merging two multi dimensional arrays, overwriting existing values
<?php
/**
* array_merge_recursive does indeed merge arrays, but it converts values with duplicate
* keys to arrays rather than overwriting the value in the first array with the duplicate
* value in the second array, as array_merge does. I.e., with array_merge_recursive,
* this happens (documented behavior):
*
* array_merge_recursive(array('key' => 'org value'), array('key' => 'new value'));
* => array('key' => array('org value', 'new value'));
@abhinavlal
abhinavlal / reset_autoincrement.sh
Created January 19, 2013 08:45
Reset auto increment of all tables in a mysql database
mysql -Nsr -e "SELECT t.table_name FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema = 'DB_NAME'" | xargs -I {} mysql DB_NAME -e "ALTER TABLE {} AUTO_INCREMENT = 1;"