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 / setup_ubuntu_24.md
Last active November 7, 2024 23:39
Setting up Ubuntu for my development environment and other utilities

Ubuntu 24.0

Update and Upgrade

sudo apt update && sudo apt upgrade

Minimize to click

@humbertodosreis
humbertodosreis / Main.kt
Last active September 9, 2024 23:15
Given an array of characters and another array of words, create a function that can tell which words can be formed with the characters of the array.
package com.github.humbertodosreis
/**
* Given an array of characters and another array of words, create a function that can tell which words can be formed with the characters of the array.
* characters = ['o', 'f', 'c' ,'f', 'e', 'e', 'i', 'n', 't', 'b', 'l']
* words = ['coffin' , 'coffee', 'win', 'beetle']
* output = ['coffin' , 'coffee']
*/
fun main() {
val characters = arrayOf('o', 'f', 'c', 'f', 'e', 'e', 'i', 'n', 't', 'b', 'l')
@humbertodosreis
humbertodosreis / Convert .mov or .MP4 to .gif.md
Created May 9, 2024 19:42 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@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 '.'