Skip to content

Instantly share code, notes, and snippets.

View isaaclopes's full-sized avatar

Isaac Lopes isaaclopes

View GitHub Profile
@isaaclopes
isaaclopes / magento-nginx.conf
Created May 14, 2019 13:53 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
@isaaclopes
isaaclopes / letsencrypt_2017.md
Created June 6, 2018 15:18 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@isaaclopes
isaaclopes / gist:e1d7593396a029673fa7
Last active August 29, 2015 14:08 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@isaaclopes
isaaclopes / 0_reuse_code.js
Created July 12, 2014 00:33
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
public function findToArray($id)
{
$result = $this->find($id)->toArray();
return $result;
}

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@isaaclopes
isaaclopes / atributos
Created January 23, 2014 12:41
atributos
$_product = $this->getProduct();
<table width="90%" align="center"class="data-table dados">
<?php if ($categoriaproduto = $this->getProduct()->getAttributeText('categoria_produto')):?>
<tr class="odd">
<td class="cart_name">Categoria:</td>
<td width="80%"><?php echo $categoriaproduto;?></td>
</tr>
<?php endif;?>
</table>
@isaaclopes
isaaclopes / Eval.php
Created August 13, 2013 18:48
/app/code/local/Mirasvit/FeedExport/Helper/Eval.php
<?php
/*
############### Exemplo do XML do Jacotei
Basta chamar o price com as funcões assim:
<parcelas>{price,[numerototalparcelas]}</parcelas>
<valor>{price,[valortotalparcelas]}</valor>
*/
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>Data feed Title</title>
<link>{base_url}</link>
<description>Data feed description.</description>
{each type="product"}
<item>
<g:id>{sku}</g:id>
<title><![CDATA[{name,[html_entity_decode]}]]></title>