Skip to content

Instantly share code, notes, and snippets.

Avatar

Ricardo Martins r-martins

View GitHub Profile
@r-martins
r-martins / ps-payment-info.json
Created Jul 13, 2022
Exemplo additional_info PagSeguro
View ps-payment-info.json
{
"transaction_id":"F3BAF8D0-5E50-4DF6-A2BF-F71BFFD1CA7C",
"sender_hash":"53dea26365b88a7204b99b90ef091688f7c3bbdf1583dc8a680dc779b71997f8",
"credit_card_token":"e2ae0986e8ed49dfb2c0aa4d3b94ea6b",
"credit_card_owner":"Ricardo Martins",
"rm_pagseguro_cc_cpf":"01234567890",
"credit_card_owner_birthdate":"10\/07\/1990",
"installment_quantity":2,
"installment_value":"5.27",
"method_title":"Cart\u00e3o de Cr\u00e9dito via PagSeguro UOL",
@r-martins
r-martins / csp_whitelist.xml
Created Jun 25, 2020
Whitelist CSP PagSeguro Domains
View csp_whitelist.xml
<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policies>
<policy id="script-src">
<values>
<value id="pagseguro-static" type="host">https://stc.pagseguro.uol.com.br</value>
<value id="pagseguro-static-sandbox" type="host">https://sandbox.stc.pagseguro.uol.com.br</value>
</values>
</policy>
<policy id="frame-src">
@r-martins
r-martins / Data.php
Created Apr 30, 2020
Exemplo de uso de helpers em layout xml
View Data.php
<?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
View boacompra-authorization-prerequest-script.js
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 / IntallPerconaOSX.md
Last active May 30, 2022 — forked from amura2406/IntallPerconaOSX.md
Steb-by-Step to Install Percona Server (Alternative to MySQL) on Mac OS X 10.11.6 (El Capitan)
View IntallPerconaOSX.md

Install percona-server.

Install from homebrew

brew install percona-server

Initialize the DB

unset TMPDIR
mysqld --initialize --datadir=/usr/local/var/mysql --user= --port=3307 --general-log-file=/var/log/percona/percona-error.log
@r-martins
r-martins / magento-design-exception.txt
Created Oct 17, 2015
Magento Design Exception - Para Mobile
View magento-design-exception.txt
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
@r-martins
r-martins / ec2-swap.txt
Created Dec 9, 2012
creating swap on amazon ec2 micro
View ec2-swap.txt
http://www.prowebdev.us/2012/05/amazon-ec2-linux-micro-swap-space.html
@r-martins
r-martins / xmllint.txt
Created Dec 5, 2012
Encontrando erros de formatação em XML's
View xmllint.txt
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 / hdmi.txt
Created Oct 21, 2012
Fazendo o audio sair no HDMI no Ubuntu
View hdmi.txt
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 / utf-8 e bom.txt
Created Oct 8, 2012
Encontrando arquivos UTF-8 com BOM
View utf-8 e bom.txt
grep -rl $'\xEF\xBB\xBF' .
Mais info em
http://stackoverflow.com/questions/204765/elegant-way-to-search-for-utf-8-files-with-bom