Skip to content

Instantly share code, notes, and snippets.

View danperrout's full-sized avatar
👍

Daniel danperrout

👍
View GitHub Profile
@danperrout
danperrout / SELIC.gs
Created June 3, 2021 16:08
API Função SELIC Google Planilhas (Sheets)
/*
* @return Retorna a taxa anual da SELIC de acordo com a data passada (se não for passada nenhuma data retorna a taxa anual do dia de hoje).
* Fonte: https://www.bcb.gov.br/estabilidadefinanceira/selicdadosdiarios
**/
function SELIC(dataConsulta = new Date()) {
var today = Utilities.formatDate(new Date(), "GMT+3", "dd/MM/yyyy");
if (dataConsulta.length == 0)
dataConsulta = new Date()
@danperrout
danperrout / merge.py
Created July 15, 2020 13:33
Merge two or more PDF with Python - Easy and simple
# Merging two or more PDF files
# Install PyPDF2 with pip
# ´pip install PyPDF2´
# Save this file on the folder and run it on the terminal with ´python merge.py´
import glob
from PyPDF2 import PdfFileMerger
def merger(output_path, input_paths):
pdf_merger = PdfFileMerger()
@danperrout
danperrout / TesouroDireto.gs
Last active February 2, 2024 10:59
API Função TESOURODIRETO Google Sheets
/*
* @return Retorna a cotação atual de um título específico do Tesouro Direto.
* Fonte: https://www.tesourodireto.com.br/titulos/precos-e-taxas.htm
**/
function TESOURODIRETO(bondName, argumento="r") {
let srcURL = "https://www.tesourodireto.com.br/json/br/com/b3/tesourodireto/service/api/treasurybondsinfo.json";
let jsondata = UrlFetchApp.fetch(srcURL);
let parsedData = JSON.parse(jsondata.getContentText()).response;
for(let bond of parsedData.TrsrBdTradgList) {
@danperrout
danperrout / language.js
Created March 20, 2019 18:35 — forked from GustavoEmmel/language.js
Joi pt-BR language
'use strict';
const internals = {};
exports.errors = {
root: 'value',
key: '"{{!key}}" ',
messages: {
wrapArrays: true
},