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 / creditcard.js
Created February 21, 2024 08:18
Extending jQuery creditCard
/*region extending cards and card types from jqueryPayment to support new types*/
const typesPagBank = [
title: 'MasterCard',
type: 'mastercard',
pattern: '^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$',
gaps: [4, 8, 12],
lengths: [16],
code: {
name: 'CVC',
r-martins / ps-payment-info.json
Created July 13, 2022 04:38
Exemplo additional_info PagSeguro
"credit_card_owner":"Ricardo Martins",
"method_title":"Cart\u00e3o de Cr\u00e9dito via PagSeguro UOL",
r-martins / csp_whitelist.xml
Created June 25, 2020 00:49
Whitelist CSP PagSeguro Domains
<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policy id="script-src">
<value id="pagseguro-static" type="host"></value>
<value id="pagseguro-static-sandbox" type="host"></value>
<policy id="frame-src">
r-martins / Data.php
Created April 30, 2020 01:52
Exemplo de uso de helpers em layout xml
* 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 (
* @license MIT License
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 /
Last active May 30, 2022 18:29 — forked from amura2406/
Steb-by-Step to Install Percona Server (Alternative to MySQL) on Mac OS X 10.11.6 (El Capitan)

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 / 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
r-martins / ec2-swap.txt
Created December 9, 2012 19:33
creating swap on amazon ec2 micro
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 / 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