This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "or_loevBbzSrxCdqvRq", | |
"code": "ROJ4A1ET5Y", | |
"amount": 2990, | |
"currency": "BRL", | |
"closed": true, | |
"items": [ | |
{ | |
"id": "oi_K4g89nMs52Fa23aO", | |
"type": "product", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(request) { | |
// get first page from current spreatsheet | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getSheets()[0]; | |
var result = sheet.appendRow([ | |
"doGet", | |
"sample" | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create checkouts | |
function doGet(request) { | |
var sk = "sk_xxxxxxxxxxxxxxxxxxx"; | |
var acceptedAmounts = [ "10", "50" ]; | |
var amount = request.parameter.amount; | |
if (!acceptedAmounts.includes(amount)) { | |
throw "invalid amount"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// receive webhooks | |
function doPost(request) { | |
var charge = JSON.parse(request.postData.contents).data; | |
// get first page from current spreatsheet | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getSheets()[0]; | |
var result = sheet.appendRow([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install openvpn openconnect | |
# Requesting password | |
sudo openconnect -u user --passwd-on-stdin vpn.example.com | |
# OR non-interactive | |
echo "<password>" | sudo openconnect --user=thiagobarradas --authgroup=MYGROUP --passwd-on-stdin vpn.xxx.com | |
# Force Stop! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NewRelic | |
RUN apt-get update && apt-get install -y wget ca-certificates gnupg \ | |
&& echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | tee /etc/apt/sources.list.d/newrelic.list \ | |
&& wget https://download.newrelic.com/548C16BF.gpg \ | |
&& apt-key add 548C16BF.gpg \ | |
&& apt-get update \ | |
&& apt-get install -y newrelic-netcore20-agent | |
# Generic settings | |
ENV CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CRIANDO E CONFIGURANDO PROJETO | |
git init | |
git remote add origin [email protected]:ThiagoBarradas/my-project.git | |
# Faz modificações no projeto e faz commits etc | |
# Agora, vamos adicionar a primeira tag, fazer o merge para develop e sincronizar com o remote | |
# Assim teremos a estrutura das branches fixas | |
git tag 0.0.1 | |
git checkout -b develop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CRIANDO E CONFIGURANDO PROJETO | |
git init | |
git remote add origin [email protected]:ThiagoBarradas/my-project.git | |
# Faz modificações no projeto e faz commits etc | |
# Agora, vamos adicionar a primeira tag, fazer o merge para develop e sincronizar com o remote | |
# Assim teremos a estrutura das branches fixas | |
git tag 0.0.1 | |
git checkout -b develop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Payment ProcessPayment(Payment payment) | |
{ | |
var transaction = this.BankService.CreateTransaction(payment); | |
payment.AddBankTransaction(transaction); | |
var mail = new MailMessage(); | |
mail.From = new MailAddress(payment.Merchant.Email); | |
mail.To.Add(payment.Customer.Email); | |
mail.Subject = "Bla bla bla"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PaymentService | |
{ | |
// ctors | |
// properties | |
// etc | |
public Payment ProcessPayment(Payment payment) | |
{ | |
var transaction = this.BankService.CreateTransaction(payment); |