Skip to content

Instantly share code, notes, and snippets.

View albertobraschi's full-sized avatar

Alberto Braschi albertobraschi

View GitHub Profile
--
-- Magento CE database clean-up extended
--
-- This is an extended clean-up which will clean search, import/export, reports, etc.
--
-- @author Constantin Bejenaru <boby@frozenminds.com>
-- @copyright Copyright (c) Constantin Bejenaru (http://frozenminds.com/)
-- @license http://www.opensource.org/licenses/mit-license.html MIT License
--
@albertobraschi
albertobraschi / gist:bdba43087fc237d7d42b
Created February 19, 2015 15:45
erro mercadolivre_adminhtml_category_index
Recoverable Error: Object of class Mage_Core_Model_Store could not be converted to string in /var/www/mercadolivre/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 2707
#0 /var/www/mercadolivre/lib/Varien/Db/Adapter/Pdo/Mysql.php(2707): mageCoreErrorHandler(4096, 'Object of class...', '/var/www/mercad...', 2707, Array)
#1 /var/www/mercadolivre/lib/Varien/Data/Collection/Db.php(483): Varien_Db_Adapter_Pdo_Mysql->prepareSqlCondition('category.store_...', Object(Mage_Core_Model_Store))
#2 /var/www/mercadolivre/app/code/local/Acaldeira/Mercadolivre/Model/Mysql4/Category/Collection.php(14): Varien_Data_Collection_Db->_getConditionSql('category.store_...', Object(Mage_Core_Model_Store))
#3 /var/www/mercadolivre/app/code/local/Acaldeira/Mercadolivre/Block/Adminhtml/Category/Grid.php(24): Acaldeira_Mercadolivre_Model_Mysql4_Category_Collection->addFieldToFilter('category.store_...', Object(Mage_Core_Model_Store))
#4 /var/www/mercadolivre/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(626): Acaldeira_Mercadolivre_Blo
odoo@ubuntu:~/bin$ cd /opt/odoo/ && bin/start_odoo_develop
2015-07-02 16:16:35,933 1114 INFO ? openerp: OpenERP version 7.0
2015-07-02 16:16:35,943 1114 INFO ? openerp: addons paths: /opt/odoo/parts/odoo/openerp/addons,/opt/odoo/parts/odoo/addons,/opt/odoo/nfe,/opt/odoo/l10n_br_core,/opt/odoo/account-fiscal-rule,/opt/odoo/server-tools
2015-07-02 16:16:35,944 1114 INFO ? openerp: database hostname: localhost
2015-07-02 16:16:35,947 1114 INFO ? openerp: database port: 5432
2015-07-02 16:16:35,949 1114 INFO ? openerp: database user: odoo
2015-07-02 16:16:39,860 1114 INFO ? openerp.addons.google_docs.google_docs: GData lib version `%s GData-Python/2.0.16` detected
2015-07-02 16:16:43,373 1114 CRITICAL ? openerp.modules.module: Couldn't load module web
2015-07-02 16:16:43,389 1114 CRITICAL ? openerp.modules.module: unsupported locale setting
2015-07-02 16:16:43,406 1114 ERROR ? openerp.service: Failed to load server-wide module `web`.
=> Booting Mongrel
=> Rails 2.3.3 application starting on http://0.0.0.0:3000
/home/usuario/rails/adriana/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Calculator (NameError)
from /home/usuario/rails/adriana/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
from /home/usuario/rails/adriana/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
from /home/usuario/rails/adriana/vendor/extensions/correios_shipping_calculator/app/models/sedex_calculator.rb:1
from /home/usuario/rails/adriana/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'
from /home/usuario/rails/adriana/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `load_file'
from /home/usuario/rails/adriana/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /home/usuario/rails/adriana/vendor/rails/activ
class CreateImports < ActiveRecord::Migration
def self.up
create_table :imports do |t|
t.string :datatype
t.integer :processed, :default => 0
t.string :csv_file_name
t.string :csv_content_type
t.integer :csv_file_size
t.timestamps
end
<?php
add_filter( 'woocommerce_enqueue_styles', 'my_woocommerce_styles' );
function my_woocommerce_styles($styles){
unset($styles['woocommerce-layout']);
unset($styles['woocommerce-smallscreen']);
$styles['woocommerce-layout'] = array(
'src' => get_stylesheet_directory_uri() . '/woocommerce-layout.css',
'deps' => '',
'version' => '1.0.0',
'media' => 'all'
@albertobraschi
albertobraschi / debug_moip
Created December 18, 2013 18:51
requisição enviada, em formato json; retorno recebido, em formato json;
2013-12-18T18:49:57+00:00 DEBUG (7): {"pagamentoWidget":{"referer":"http:\/\/magento.localhost\/","token":"R2T0O1A3Y1S2L1K8S1G6A4Q9D5L66319Z23040Q0A0A0R0O4I2N60497Q9V7","dadosPagamento":{"Forma":"CartaoCredito","Instituicao":"AmericanExpress","Parcelas":"5","Recebimento":"AVista","CartaoCredito":{"Numero":"0000000000000000","Expiracao":"6\/2017","CodigoSeguranca":"000","Portador":{"Nome":"aaaaaaaaaa","DataNascimento":"01\/06\/1981","Telefone":"4135270877","Identidade":"037.486.909-08"}}}}}
2013-12-18T18:50:02+00:00 DEBUG (7): ?({"Status":"EmAnalise","Codigo":0,"TaxaMoIP":"354.17","StatusPagamento":"Sucesso","Classificacao":{"Codigo":999,"Descricao":"Não suportado no ambiente Sandbox"},"CodigoMoIP":190845,"Mensagem":"Requisição processada com sucesso","TotalPago":"2699.99"})
@albertobraschi
albertobraschi / php7_build_ubuntu15.04-15.10.sh
Created January 12, 2016 14:58 — forked from m1st0/php_build_ubuntu.sh
Compiling PHP 7 on Ubuntu 15.04 with LDAP Support
#! /bin/bash
## PHP 7 Initial Compile ##
## Some help from the various places like these. ##
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
## Setup Ubuntu 15.04/15.10 ##
# Other dependencies for PHP 7. Add any missing ones from configure script
# complaints, plus some LAMP needs too.
@albertobraschi
albertobraschi / Magento-HHVM.md
Created February 2, 2016 12:59 — forked from SchumacherFM/Magento-HHVM.md
Running Magento Enterprise Edition with Facebook HipHop HHVM

Running Magento Enterprise Edition with Facebook HipHop HHVM

Prerequisites

Hardware

MacBook Air (MBA) Mid 2012

@albertobraschi
albertobraschi / hhvm_magento_setup.md
Created February 2, 2016 13:01 — forked from tegansnyder/hhvm_magento_setup.md
HHVM Magento Server Setup

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm