Skip to content

Instantly share code, notes, and snippets.

View luizventurote's full-sized avatar

Luiz Venturote luizventurote

View GitHub Profile
@luizventurote
luizventurote / 0_reuse_code.js
Created June 17, 2017 17:16
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
@luizventurote
luizventurote / debug_xml_magento2.md
Created June 2, 2017 05:12 — forked from gelanivishal/debug_xml_magento2.md
Debugging layout XML loading in Magento 2

Open following file :

{root}/vendor/magento/framework/View/Model/Layout/Merge.php

and find _loadFileLayoutUpdatesXml function at line number 681.

Just echo $file->getFilename(); in foerach. You can see list of layout xml files adding in that action.

@luizventurote
luizventurote / git-fix.md
Last active April 18, 2017 15:20
Fix Git commit after rebase

git reset --hard origin/staging

git merge --no-edit feature/theme

git push

@luizventurote
luizventurote / test.magento.php
Created December 3, 2016 19:43
Test File Magento.
<?php
require_once('app/Mage.php'); //Path to Magento
Mage::app();
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
@luizventurote
luizventurote / backup-mysql-database.md
Last active February 16, 2018 22:06
Backup MySql database

Using n9m-Magerun for Magento

When you guys create a local dev environment, run this command to create database backup:

n98-magerun db:dump --strip='@development' --stdout | gzip > site-type-$(date +%Y%m%d%H%M%S).sql.gz

Replace “site" with the name of the site that you are backing up and “type" with either “prod”, “dev”, or “stage”.

MySql Dump

@luizventurote
luizventurote / compress-and-uncompress.md
Created November 29, 2016 11:20
Compress and Uncompress

Compress

tar -cvzf filename.tar.gz folder

Uncompress

tar -xvzf filename.tar.gz
@luizventurote
luizventurote / magento-1-removes-default-blocks.md
Created October 31, 2016 16:10
Removes default blocks on Magento 1.

Removing the shopping cart at the right side

<remove name=”right.cart_sidebar”/>

Removing the standard banners

@luizventurote
luizventurote / magento-cron-configuration.md
Created October 17, 2016 16:00
Magento Cron configuration

Magento 1

Log in to the server via SSH. Run crontab -e command to add a cron task.

Add these lines on file:

MAILTO="webmaster@example.com"
*/5 * * * * php -f /var/www/html/cron.php
0 2 * * * php -f /var/www/html/shell/indexer.php reindexall
@luizventurote
luizventurote / magento-1-change-domain-database.md
Created October 17, 2016 13:22
Change Magento 1 domain on database
select * from core_config_data where path like '%base%url%';
update core_config_data set value = 'http://domainname/' where path = 'web/unsecure/base_url';
update core_config_data set value = 'http://domainname/' where path = 'web/secure/base_url';