Skip to content

Instantly share code, notes, and snippets.

View deivisonarthur's full-sized avatar

Deivison Arthur Lemos Serpa deivisonarthur

View GitHub Profile
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRespectVary on
ModPagespeedXHeaderValue "Powered By mod_pagespeed"
ModPagespeedEnableFilters add_instrumentation
ModPagespeedEnableFilters extend_cache
ModPagespeedForceCaching on
ModPagespeedDisallow *timthumb.php*
ModPagespeedDomain http://thecustomizewindows.com
ModPagespeedDomain http://*.google.com
@deivisonarthur
deivisonarthur / send-custom-template.php
Last active August 29, 2015 13:56
Como enviar template customizada pelo magento e como setar variáveis na template. Outra opção é como criar invoice auto e ou apos pagamento no modulo de pagamento enviando email de invoice
<?php
public function sendCustomMail($CustomerName, $email, $increment_id, $template) {
// Load from magento config..
$sender = Array('name' => Mage::getStoreConfig('trans_email/ident_sales/name'), 'email' => Mage::getStoreConfig('trans_email/ident_sales/email') );
$storeId = Mage::app()->getStore()->getId();
$translate = Mage::getSingleton('core/translate');
$datetime = new DateTime();

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

# Get all the pre-reqs installed:
sudo apt-get install git-core cmake g++ libboost-dev libmysqlclient-dev \
libxml2-dev libmcrypt-dev libicu-dev openssl build-essential binutils-dev \
libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev \
autoconf libtool libcurl4-openssl-dev libboost-system-dev \
libboost-program-options-dev libboost-filesystem-dev wget memcached \
libreadline-dev libncurses-dev libmemcached-dev libbz2-dev \
libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev \
libelf-dev libdwarf-dev subversion \
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRespectVary on
ModPagespeedXHeaderValue "Powered By mod_pagespeed"
ModPagespeedEnableFilters add_instrumentation
ModPagespeedEnableFilters extend_cache
ModPagespeedForceCaching on
ModPagespeedDisallow *timthumb.php*
ModPagespeedDomain http://thecustomizewindows.com
ModPagespeedDomain http://*.google.com

Running Magento Enterprise Edition with Facebook HipHop HHVM

Prerequisites

Hardware

MacBook Air (MBA) Mid 2012

@deivisonarthur
deivisonarthur / 0_reuse_code.js
Created May 15, 2014 06:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$category = Mage::getModel('catalog/category')->load(100);
$allChildsIds = $category->getAllChildren($category);
$visibility = Mage::getModel('catalog/product_visibility');
$collection = Mage::getResourceModel('catalog/product_collection');
$collection = $this->_addProductAttributesAndPrices($collection)
->addStoreFilter()
->setFlag('do_not_use_category_id', true)
->setFlag('disable_root_category_filter', true)
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION