Skip to content

Instantly share code, notes, and snippets.

View rafaelstz's full-sized avatar
👨‍🔬

Rafael Corrêa Gomes rafaelstz

👨‍🔬
View GitHub Profile
@rafaelstz
rafaelstz / post.md
Last active August 29, 2015 14:01 — forked from kbond/post.md
How to configure server

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

@rafaelstz
rafaelstz / gist:38eb47672d05a6518bb8
Last active August 29, 2015 14:01 — forked from quafzi/gist:2234563
Magento Snippets

Magento Snippets

Find all dispatched event observers

grep -r Mage::dispatchEvent /path/to/your/Magento/* > events.txt

Find all translatable strings

@rafaelstz
rafaelstz / mysql-bkp-shell.sh
Last active August 29, 2015 14:01
Backup do Banco via ShellScript
#
# script by israelguido@gmail.com
#
echo "Digite seu dns";
read host;
echo "Digite seu user";
read user;
echo "Digite seu pass";
stty -echo
@rafaelstz
rafaelstz / find_txt_and_add_class.js
Last active August 29, 2015 14:07
Procura texto em uma classe e adiciona a classe.
if ( jQuery('.product-desc').length > 0 ) {
jQuery(function(){
jQuery('.product-desc').each(function(){
if ( jQuery(this).find(".prod-desc-tipo:contains('Grãos')").length > 0 ) {
jQuery(this).find('.icon').addClass('icon1');
}
else if ( jQuery(this).find(".prod-desc-tipo:contains('Cápsula')").length > 0 ) {
jQuery(this).find('.icon').addClass('icon2');
}
@rafaelstz
rafaelstz / price_product.js
Last active August 29, 2015 14:07
Colocado na Product View no Magento ele atualiza dinamicamente o valor do produto ao aumentar ou diminuir quantidade.
jQuery(window).load(function(){
/* Começa quando se clica em qualquer seta (cima e baixo) */
jQuery('.qty_control').click(function(){
// Quantidade no input
var quant = jQuery('.qty').val();
// Pega o preço (exemplo: 12.00)
var total = <?php echo $_product->getPrice(); ?>;
@rafaelstz
rafaelstz / .htaccess
Last active August 29, 2015 14:07
Otimização para compactar conteúdo gzip, definir cachê e etc.
<IfModule mod_deflate.c>
# Insert filter on all content
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
FileETag none
#php_flag zlib.output_compression On
# Make sure proxies don't deliver the wrong content
@rafaelstz
rafaelstz / get_url_Magento.txt
Created November 7, 2014 01:01
Pega a URL Base de um diretório matrix do Magento e exibe no phtml.
Get Url in phtml files
1. Get Base Url :
Mage::getBaseUrl();
2. Get Skin Url :
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
@rafaelstz
rafaelstz / local.xml
Last active December 2, 2016 14:18
Remover links da barra lateral "Minha Conta" no Magento.Arquivo yourPackage/YourTemplate/customer/account/navigation.phtml
<!-- Remove My account sidebar links Magento -->
<customer_account>
<reference name="left">
<action method="unsetChild">
<name>customer_account_navigation</name>
</action>
<block type="customer/account_navigation" name="customer_account_navigation"
before="-" template="customer/account/navigation.phtml">
<action method="addLink" translate="label" module="customer">
<name>account</name>
@rafaelstz
rafaelstz / README.md
Last active August 29, 2015 14:09 — forked from aronwoost/README.md

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

@rafaelstz
rafaelstz / robots.txt
Last active February 21, 2017 07:01
Robots para Magento
## robots.txt for Magento Community and Enterprise
## GENERAL SETTINGS
## Enable robots.txt rules for all crawlers
User-agent: *
## Crawl-delay parameter: number of seconds to wait between successive requests to the same server.
## Set a custom crawl rate if you're experiencing traffic problems with your server.
# Crawl-delay: 30