Skip to content

Instantly share code, notes, and snippets.

View r-martins's full-sized avatar

Ricardo Martins r-martins

View GitHub Profile
@r-martins
r-martins / linux.txt
Created June 20, 2012 16:16
Mapear unidade de rede do windows no linux
sudo smbmount //[REMOTE IP]/[REMOTE FOLDER] /path/to/existing/local/folder -o username=[username],password=[password]
@r-martins
r-martins / git.txt
Created July 4, 2012 12:47
Adicionando arquivos de um commit específico para um .tar
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $commit_id | xargs tar -rf mytarfile.tar
@r-martins
r-martins / magento.txt
Created July 4, 2012 17:20
Inserir bloco no magento via xml
Primeiro devemos ter o text_list inserido em algum ponto-chave da pagina com o $this->getChildHtml()..
No XML ficaria assim:
<block type="core/text_list" name="before_main_div_end" as="before_main_div_end" translate="label">
<label>Fim do conteudo principal da pagina</label>
</block>
Depois é só inserir os phtml qdo necessário... Ex:
@r-martins
r-martins / utf-8 e bom.txt
Created October 8, 2012 19:46
Encontrando arquivos UTF-8 com BOM
grep -rl $'\xEF\xBB\xBF' .
Mais info em
http://stackoverflow.com/questions/204765/elegant-way-to-search-for-utf-8-files-with-bom
@r-martins
r-martins / hdmi.txt
Created October 21, 2012 11:47
Fazendo o audio sair no HDMI no Ubuntu
speaker-test -c 2 -r 48000 -D hw:0,3
- pausar o teste com ctrl+c
- e depois o hdmi aparecera no treco de som
@r-martins
r-martins / xmllint.txt
Created December 5, 2012 13:33
Encontrando erros de formatação em XML's
for file in `find . -name "*.xml"`; do xmllint --noout $file; done
fará uma busca por todos os arquivos xml recursivamente e mostrará se houver algum com erro de sintaxe, tags nao fechadas, etc
@r-martins
r-martins / ec2-swap.txt
Created December 9, 2012 19:33
creating swap on amazon ec2 micro
http://www.prowebdev.us/2012/05/amazon-ec2-linux-micro-swap-space.html
@r-martins
r-martins / magento-design-exception.txt
Created October 17, 2015 03:08
Magento Design Exception - Para Mobile
iP(hone|od)|(a|A)ndroid.*(m|M)(obile|ini)|(a|A)ndroid 3|BlackBerry|IEMobile|Windows Mobile|Windows Phone|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune|Googlebot-Mobile
var secret = pm.variables.get("secret")
var merchant_id = pm.variables.get("store_id")
var Header = require('postman-collection').Header
var requestMethod = pm.request.method
// console.log(contentMd5)
@r-martins
r-martins / Data.php
Created April 30, 2020 01:52
Exemplo de uso de helpers em layout xml
<?php
/**
* PagSeguro Transparente Magento
* Helper Class - responsible for helping on gathering config information
*
* @category RicardoMartins
* @package RicardoMartins_PagSeguro
* @author Ricardo Martins
* @copyright Copyright (c) 2015 Ricardo Martins (http://r-martins.github.io/PagSeguro-Magento-Transparente/)
* @license https://opensource.org/licenses/MIT MIT License