Skip to content

Instantly share code, notes, and snippets.

View tiagones's full-sized avatar

Tiago P Dantas tiagones

View GitHub Profile
@tiagones
tiagones / transaction-email-variables
Created September 29, 2015 17:55
Magento - Transaction Email Variables
Para a inscrição:
1. {{var customer}} irá imprimir todas as informações do cliente
2. {{var customer.ID}}
3. {{var customer.email}}
4. {{var customer.firstname}}
5. {{var customer.lastname}}
6. {{var customer.name}}
7. {{var customer.password}}
8. {{var customer.created_in}}
@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'): ?>
@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-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`;
{
"directory": "assets/_src/bower_components/",
"scripts": {
"postinstall": "./bower-postinstall.bat"
}
}
<?php
##Test What Exact Version PHP & MySQL
echo "<h2>Exact Version PHP & MySQL: </h2>";
printf("PHP version: %s\n", PHP_VERSION);
$mysql = mysqli_connect('localhost', 'root', '');
## Test the MySQL connection
if (mysqli_connect_errno()) {
printf("</br> Connection failed: %s\n", mysqli_connect_error());
exit();
}
@tiagones
tiagones / projeto.sublime-project
Last active August 29, 2015 14:25
Projeto Sublime Text
{
"folders":
[
{
"path": "app/design/frontend/default/dhcpv5",
"name": "app/design/frontend/default/dhcpv5"
},
{
"path": "skin/frontend/default/dhcpv5",
"name": "skin/frontend/default/dhcpv5"
@tiagones
tiagones / humans.txt
Created August 8, 2014 02:00
humans.txt from HTML5 ★ BOILERPLATE
# humanstxt.org/
# The humans responsible & technology colophon
# TEAM
<name> -- <role> -- <twitter>
# THANKS
<name>
@tiagones
tiagones / robots.txt
Last active August 29, 2015 14:05
Robots.txt Magento Boilerplate
# Google Image Crawler Setup
User-agent: Googlebot-Image
Disallow: /
Allow: /media/catalog/product/
# Yahoo! Multimedia Crawler Setup
User-agent: yahoo-mmcrawler
Disallow: /
Allow: /media/catalog/product/