Skip to content

Instantly share code, notes, and snippets.

View lucashmsilva's full-sized avatar

Lucas Henrique lucashmsilva

  • Ouro Preto, MG, Brazil
View GitHub Profile
provider "aws" {
region = var.region
# para tentar rodar no localstack
# skip_credentials_validation = true
# skip_metadata_api_check = true
# skip_requesting_account_id = true
# endpoints {
# apigateway = "http://localhost:4566"
# sns = "http://localhost:4566"
@lucashmsilva
lucashmsilva / TESOURODIRETO(taxa).js
Last active August 30, 2024 15:22
API para criar a função TESOURODIRETO Google Sheets
/*
* @return Retorna a cotação atual de um título específico do Tesouro Direto Junto com a taxa anual de retorno
* @customfunction
**/
function TESOURODIRETO(bondName) {
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) {
@lucashmsilva
lucashmsilva / prepare-commit-msg.sh
Last active February 14, 2019 18:07 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@lucashmsilva
lucashmsilva / coin-hive(with optout).js
Created September 18, 2017 20:28
A coin hive client code with a simple optout pop-up, with the response save to a cookie to enable monero mining inside the browser
<script>
function startMine(){
var miner = new CoinHive.Anonymous(<your site key here>);
miner.setNumThreads(miner.getNumThreads()/2);
miner.start();
}
function opt(){
var inout = window.confirm("This page use your machine to mine Monero currency to help with the costs. You can opt out clicking cancel");