Skip to content

Instantly share code, notes, and snippets.

View deivisonarthur's full-sized avatar

Deivison Arthur Lemos Serpa deivisonarthur

View GitHub Profile
root@ip-10-253-143-111:/mnt/www/lojamodelo/shell# ./warm-cache.sh http://lojamodelo.inovarti.com.br/sitemap.xml
Getting URLs from sitemap...
Warming 130 URLs using 1 processes...
HTTP/1.1 200 1.05 secs: 12187 bytes ==> GET /women/new-arrivals.html
HTTP/1.1 200 1.10 secs: 12098 bytes ==> GET /women/tops-blouses.html
HTTP/1.1 200 0.90 secs: 11632 bytes ==> GET /women/pants-denim.html
HTTP/1.1 200 0.93 secs: 12415 bytes ==> GET /women/dresses-skirts.html
HTTP/1.1 200 1.13 secs: 12117 bytes ==> GET /men/new-arrivals.html
HTTP/1.1 200 0.92 secs: 11867 bytes ==> GET /men/shirts.html
HTTP/1.1 200 1.08 secs: 11365 bytes ==> GET /men/tees-knits-and-polos.html
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_category_entity`;
TRUNCATE TABLE `catalog_category_entity_datetime`;
TRUNCATE TABLE `catalog_category_entity_decimal`;
TRUNCATE TABLE `catalog_category_entity_int`;
TRUNCATE TABLE `catalog_category_entity_text`;
TRUNCATE TABLE `catalog_category_entity_varchar`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `catalog_category_product_index`;
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
@deivisonarthur
deivisonarthur / mysql4-upgrade-2.0.0-2.0.1.php
Created October 1, 2014 05:51
OSC 6 Pro - Forçando o SETUP 1 (Incluindo os Estados)
include_once 'app/Mage.php';
//Mage::app('default');
Mage::app();
$installer = Mage::getResourceModel('sales/setup', 'default_setup');
//$installer = $this;
$installer->startSetup();
/**
@deivisonarthur
deivisonarthur / gist:fc3ee625831e257c5154
Created February 11, 2015 00:46
Remover validação do método de pagamento Mundipagg para reload do review com desconto
jQuery('input[name="payment[method]"]').on('click', function () {
jQuery('#mundipagg_cc_type').removeClass('required-entry validate-cc-type-select');
jQuery('#mundipagg_cc_parcelamento').removeClass('required-entry validate-type-select');
jQuery('#mundipagg_cc_number').removeClass('validate-cc-number validate-cc-type');
jQuery('#mundipagg_cc_owner').removeClass('required-entry');
jQuery('#mundipagg_cc_cpf').removeClass('required-entry');
jQuery('#mundipagg_expiration').removeClass('validate-cc-exp required-entry');
jQuery('#mundipagg_expiration_yr').removeClass('required-entry');
jQuery('#mundipagg_cc_cid').removeClass('cvv required-entry validate-cc-cvn');
@deivisonarthur
deivisonarthur / configurable.php
Created February 12, 2015 02:58
Para erros de import dos produtos configuraveis do magento (Quando se faz necessário entrar no produto pelo admin e salvar para que ele aprareça)
<?php
require_once('app/Mage.php');
umask(0);
#Mage::app('default');
Mage::app();
#Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$collection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('entity_id')
@deivisonarthur
deivisonarthur / gist:cd306c1fb5b8ac10d859
Created April 9, 2015 23:28
Para tratar o erro do mcrypt pelo shell : PHP Fatal error: Call to undefined function mcrypt_module_open() in .../lib/Varien/Crypt/Mcrypt.php on line 63
sudo aptitude install mcrypt
sudo aptitude install php5-mcrypt
execute e veja se agora existe na listagem o mcrypt
php -m
fonte: http://askubuntu.com/questions/350942/cannot-get-mcrypt-for-php5
@deivisonarthur
deivisonarthur / container.php
Last active August 29, 2015 14:20
Atualiza o container dos produtos configurados. Esse problema dá quando se importa produtos configurados e não exibe o preço, somente entrando no admin e salvando cada um dos produtos é que é exibido o preço. Isso se dá porque faltou algum campo obrigatório na importação e quando se entra pelo admin ele ja vem selecionado a primeira opção, assim…
<?php
/*
Executar via cron com o comando php container.php
*/
require_once('app/Mage.php');
umask(0);
#Mage::app('default');
Mage::app();
@deivisonarthur
deivisonarthur / Mpchadwick_Missing_Acl_Checker.php
Last active September 19, 2015 05:49 — forked from mpchadwick/Mpchadwick_Missing_Acl_Checker.php
Devido o path de segurança 6285 a questão da permissão mudou no Magento.
<?php
require_once 'abstract.php';
/**
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed()
*/
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract
{
const MODULES_PATH = 'modules';