Skip to content

Instantly share code, notes, and snippets.

View rafaelpontezup's full-sized avatar

Rafael Ponte rafaelpontezup

View GitHub Profile
@rafaelpontezup
rafaelpontezup / LockManager.kt
Created October 4, 2022 20:25 — forked from soudmaijer/LockManager.kt
Postgres transaction-level advisory lock implementation that uses Spring JDBC
import org.slf4j.LoggerFactory
import org.springframework.jdbc.core.JdbcTemplate
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Propagation
import org.springframework.transaction.annotation.Transactional
import java.time.Duration
interface LockManager {
fun <T> tryWithLock(key: Long, timeout: Duration, function: () -> T): T
}
@rafaelpontezup
rafaelpontezup / pre-req.js
Created May 3, 2022 13:36 — forked from faermanj/pre-req.js
Postman OIDC
var auth_username = pm.variables.get("auth_username")
var auth_password = pm.variables.get("auth_password")
var client_id = pm.variables.get("client_id")
var client_secret = pm.variables.get("client_secret")
var authBody = `username=${auth_username}&password=${auth_password}&grant_type=password&client_id=${client_id}&client_secret=${client_secret}`;
console.log(authBody)
var force_refresh = true
var token_expires_in = pm.environment.get("token_expires_in");
var token_created = pm.environment.get("token_created");
@rafaelpontezup
rafaelpontezup / links.md
Created August 3, 2020 14:50 — forked from giggio/links.md
Links palestra "Usando um ambiente Linux completo no Windows com WSL e VSCode"