Skip to content

Instantly share code, notes, and snippets.

View WaximeA's full-sized avatar
🤷‍♂️

Maxime AVELINE WaximeA

🤷‍♂️
View GitHub Profile
@WaximeA
WaximeA / phpliteadmin_in_symfony.md
Last active April 4, 2018 20:02
Use phpLiteAdmin in symfony

Use PhpLiteAdmin in Symfony :

  1. Download PhpLiteAdmin on the official website : https://www.phpliteadmin.org/download/

  2. Add dowloaded files in a web/phpLiteAdmin/ folder

  3. Create new sqlite.db file in app/

  4. Change $directory default value to '../../app/' in phplite.php file

@WaximeA
WaximeA / override_controllers.md
Last active March 23, 2018 14:53
Override controllers in magento

Override controllers in magento :

For example, you want to override Netresearch_OPS controller (Ingenico Payment free module) :

  1. Create or use an existing module in the local codepool

  2. Add in the frontend the routers node in the module config file :

<routers>
@WaximeA
WaximeA / rewrite_user.md
Last active October 1, 2019 08:06
Rewrite all head branch commits user

How to rewrite all commits user of head branch :

Simply remplace YOUR EMAIL and YOUR NAME. Be carefull, this command will change all head branch commits user.

$ git filter-branch -f --env-filter " GIT_AUTHOR_NAME='YOUR NAME'GIT_AUTHOR_EMAIL='YOUR EMAIL' GIT_COMMITTER_NAME='YOUR NAME' GIT_COMMITTER_EMAIL='YOUR EMAIL' " HEAD

Then, force push $ git push -f

@WaximeA
WaximeA / symfony_usefull.md
Last active May 4, 2018 08:56
Usefull commands for Symfony
@WaximeA
WaximeA / symfony_usefull.md
Created February 20, 2018 14:09
Usefull commands for Symfony
@WaximeA
WaximeA / change_definer.md
Last active February 13, 2022 22:15
Change sql script definers before a local magento database import

How to change the sql script's definers before a local magento database import :

  1. First, you have to open your terminal ;)

  2. You have to install homebrew if it's not already done :

$ brew install grep

  1. Once homebrew downloaded, just enter this command in a terminal :
@WaximeA
WaximeA / reindex_manually.md
Created February 12, 2018 15:29
Reindex all magento data manually

How to reindex all data from terminal in magento

  1. Go to your project root folder and run the command bellow :

if you want to reindex all data : $ php shell/indexer.php --reindexall

if you want to reindex specific index : $ php shell/indexer.php info to show all index's name $ php shell/indexer.php --reindex index_name

@WaximeA
WaximeA / install-1.0.0.php
Last active February 9, 2018 09:12
Setup file to add attribute programmatically in Magento (Codepool/Namespace/Modulename/sql/setup_directory/install_file.php)
<?php
/** @var Mage_Eav_Model_Entity_Setup $installer */
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
// Adding customs attributes
$setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_code', [
'input' => 'textarea',
'type' => 'text',
@WaximeA
WaximeA / remove_products_magento.sql
Created February 9, 2018 08:35
SQL script that remove all products in Magento application
-- Reset all products
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE catalog_product_bundle_option;
TRUNCATE catalog_product_bundle_option_value;
TRUNCATE catalog_product_bundle_price_index;
TRUNCATE catalog_product_bundle_selection;
TRUNCATE catalog_product_bundle_selection_price;
TRUNCATE catalog_product_bundle_stock_index;
TRUNCATE catalog_product_enabled_index;
TRUNCATE catalog_product_entity;