Skip to content

Instantly share code, notes, and snippets.

View jrsguitar's full-sized avatar

Jeffeson Reis jrsguitar

View GitHub Profile
@thiagofa
thiagofa / DatabaseCleaner.java
Last active October 6, 2024 23:35
Componente Spring para limpar os dados de todas as tabelas de um banco de teste (exceto a tabela de histórico do Flyway)
// Baseado em: https://brightinventions.pl/blog/clear-database-in-spring-boot-tests/
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
@thiagofa
thiagofa / ResourceUtils.java
Created October 17, 2019 20:52
Classe utilitária que retorna a string do conteúdo de um arquivo (recurso) do classpath
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import org.springframework.util.StreamUtils;
public class ResourceUtils {
public static String getContentFromResource(String resourceName) {
try {
@thiagofa
thiagofa / login.html
Last active November 14, 2022 19:05
Templates de páginas de segurança do projeto AlgaFood
<!doctype html>
<html lang="pt" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Acesso à AlgaFood</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">