Skip to content

Instantly share code, notes, and snippets.

Avatar
💁‍♀️
I try to solve all my problems with a single SQL query.

Gabriela D'Ávila Ferrara gabidavila

💁‍♀️
I try to solve all my problems with a single SQL query.
View GitHub Profile
@gabidavila
gabidavila / product_attributes
Last active Dec 16, 2015
Alterar valor de atributo para todos os produtos no Magento Change attribute value for all products in Magento
View product_attributes
<?php
//get all products
$products = Mage::getResourceModel('catalog/product_collection')->getAllIds();
//Now create an array of attribute_code => values
$attributesData = array(
array('orig' => 1),
array('ncm' => 33030020),
array('ucom' => 'un'),
array('subst' => 1)
@gabidavila
gabidavila / Git_Colors
Created Apr 13, 2013
GIT Colorido Colored GIT
View Git_Colors
git config --global color.ui auto
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
@gabidavila
gabidavila / magento_increment_id.sql
Created Apr 13, 2013
Alterar numeração de um pedido no Magento / Change Increment ID Magento
View magento_increment_id.sql
UPDATE eav_entity_store
SET increment_last_id = '100180000'
WHERE
entity_store_id = 1
@gabidavila
gabidavila / sorce_model.php
Created Apr 13, 2013
Source model customized Magento
View sorce_model.php
<?php
class Namespace_Module_Model_Customfield extends Mage_Core_Model_Abstract {
protected function _construct() {
$this->_init('namespace/customfield');
}
public function toOptionArray() {
$options = array(
0 => array('value' => 'SP', 'label' => 'São Paulo'),
1 => array('value' => 'MG', 'label' => 'Minas Gerais'),
@gabidavila
gabidavila / estados_brasileiros.sql
Last active Aug 3, 2016
Estados Brasileiros do Magento
View estados_brasileiros.sql
INSERT INTO `directory_country_region` (`country_id`, `code`, `default_name`) VALUES
('BR', 'AC', 'Acre');
INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES
('en_US', LAST_INSERT_ID(), 'Acre'), ('pt_BR', LAST_INSERT_ID(), 'Acre');
INSERT INTO `directory_country_region` (`country_id`, `code`, `default_name`) VALUES
('BR', 'AL', 'Alagoas');
INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES
('en_US', LAST_INSERT_ID(), 'Alagoas'), ('pt_BR', LAST_INSERT_ID(), 'Alagoas');
@gabidavila
gabidavila / pacote.sh
Created Apr 15, 2013
Gerar pacote tar.gz git
View pacote.sh
git diff --name-only 859f95bc 94a94459 | tar -czvpf patch_20130207.tar.gz -T -
@gabidavila
gabidavila / Aws.sh
Created May 28, 2013
Parametros de incializacao de instancia no AWS
View Aws.sh
#!/bin/sh
yum -y install httpd php
/sbin/chkconfig httpd on
/etc/init.d/httpd start
@gabidavila
gabidavila / tamanho_db.sql
Created Sep 17, 2013
Tamanho dos bancos de dados de um determinado host
View tamanho_db.sql
SELECT
table_schema "Nome DB",
SUM( data_length + index_length) / 1024 / 1024 "Tamanho em MB"
FROM
information_schema.TABLES
GROUP BY
table_schema;
@gabidavila
gabidavila / git_file_permission.sh
Created Nov 3, 2013
Ignorar alteração de permissões de arquivos no GIT Ignore file permissions change on GIT
View git_file_permission.sh
git config core.fileMode false
@gabidavila
gabidavila / git_colors.sh
Created Nov 3, 2013
GIT Colorido na linha de comando | Add Colors to GIT command Line
View git_colors.sh
git config --global color.ui auto
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto