Skip to content

Instantly share code, notes, and snippets.

View humbertodosreis's full-sized avatar

Humberto dos Reis Rodrigues humbertodosreis

View GitHub Profile
@humbertodosreis
humbertodosreis / pipeline
Created April 26, 2021 19:52 — forked from mmonti/pipeline
Pipeline Pattern in Kotlin
package com.sunrun.fi.ingestion.input
import java.io.ByteArrayOutputStream
import java.nio.file.Paths
import java.util.zip.ZipInputStream
interface Step<I, O> {
fun process(input : I) : O
}
@humbertodosreis
humbertodosreis / setup.md
Last active August 21, 2020 18:36
Setup development env
# Install iTerm
# Install zsh
# install brew
# Install oh-my-zsh
# Install dracula theme
# Install FireCode font and configure iTerm
# Install starship
brew install starship
syntax enable
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
@humbertodosreis
humbertodosreis / cloudSettings
Created July 31, 2020 03:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-31T03:28:01.783Z","extensionVersion":"v3.4.3"}
curl -X GET \
http://localhost:8180/auth/realms/sso/protocol/openid-connect/userinfo \
-H "Authorization: Bearer TOKEN" | jq '.'
# response
{
"seller": "seller@seller.com",
"sub": "f:5e0b46cc-c7df-42ed-9727-6334cc080e59:8582812",
"email_verified": true,
"name": "Humberto Reis",
curl -X POST \
http://localhost:8180/auth/realms/sso/protocol/openid-connect/token \
-H "Content-Type='application/x-www-form-urlencoded'" \
-d "grant_type=authorization_code" \
-d "client_id=test" \
-d "client_secret=CLIENT_SECRET" \
-d "code=AUTHORIZATION_CODE" \
-d "redirect_uri=https://example.com/" \
-d "scope=openid cpf" | jq '.'
@humbertodosreis
humbertodosreis / busca_pares_produto_multiplicacao.lua
Created May 23, 2020 00:29
Dado dois parâmetros os, sendo o primeiro um vetor de inteiros e o segundo um inteiro, retorne todos os pares de inteiros cujo o resultado de sua multiplicação seja igual ao segundo parâmetro .
--[[
Dado dois parametros, sendo o primeiro um vetor de inteiros e o segundo um inteiro,
retorne todos os pares de inteiros cujo o resultado de sua
multiplicação seja igual ao segundo parametro.
Ex:In: [2, 4, 3, 1, 12, 6] e 12 Out: [(2, 6), (4, 3), (1, 12)]
--]]
local table = require "luatable"
local lista = table({2, 4, 3, 1, 12, 6})
local esperado = 12
(ns playground.mutimethods)
(defrecord DeclaracaoSimplificada [nome cpf total-redimentos])
(defrecord DeclaracaoCompleta [nome cpf total-redimentos despesas])
(defrecord Despesa [descricao valor])
(defn imposto-a-pagar-b [declaracao]
(if (record? DeclaracaoSimplificada)
(* 0.15 (:total-redimentos declaracao))
(* 0.275 (:total-redimentos declaracao))))
functions:
hello:
handler: handler.hello
events:
- http:
path: users
method: get
integration: lambda
request:
template: