Skip to content

Instantly share code, notes, and snippets.

View danperrout's full-sized avatar
👍

Daniel danperrout

👍
View GitHub Profile
@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
},
@danperrout
danperrout / TesouroDireto.gs
Last active November 6, 2024 16:03
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://api.radaropcoes.com/bonds.json";
let jsondata = UrlFetchApp.fetch(srcURL);
let parsedData = JSON.parse(jsondata.getContentText()).response;
for(let bond of parsedData.TrsrBdTradgList) {
@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 / 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 / autoeditor.sh
Last active August 22, 2024 12:58
Record a video in OBS than automatically cut the silence part. Put this script in the directory of the video.
#!/bin/bash
# This script selects the most recent .mp4 video file in the current directory (or a specified file),
# extracts video and audio bitrates using ffprobe, and runs auto-editor (https://github.com/WyattBlue/auto-editor) for automatic video processing.
# Set the directory to the current path
VIDEO_DIR="$(pwd)"
# Check if an argument is provided