Skip to content

Instantly share code, notes, and snippets.

View tiagones's full-sized avatar

Tiago P Dantas tiagones

View GitHub Profile
@tiagones
tiagones / magento-db-cleanup.sql
Created July 25, 2016 13:57 — forked from therouv/magento-db-cleanup.sql
DB cleanup script for Magento with some common database tables.
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
@tiagones
tiagones / npm-check-updates
Last active August 8, 2018 19:07
Update each dependency in package.json (npm, grunt, gulp, ...)
npm i -g npm-check-updates
ncu
ncu -u # to upgrade package.json
npm install
@tiagones
tiagones / mysql commands.sql
Last active August 7, 2018 17:34
mysql commands
-- Import dump Windows
C:\path\to\mysql.exe -u {username} -p {databasename} < file_name.sql
@tiagones
tiagones / magento-get-page-type.php
Last active September 4, 2018 15:45
Get and print the page type of a Magento page layout.
<?php
//Identify the page type
$pageIdentifier = Mage::app()->getFrontController()->getAction()->getFullActionName();
echo $pageIdentifier;
?>
<!-- Do something if on the specific page you need -->
<?php if(Mage::getBlockSingleton('page/html_header')->getIsHomePage()): ?>
home page
<?php elseif(Mage::app()->getRequest()->getRouteName()=='cms'): ?>