Skip to content

Instantly share code, notes, and snippets.

View jeffersonchaves's full-sized avatar
😎
Focusing

Jefferson Chaves jeffersonchaves

😎
Focusing
  • Instituto Federal do Paraná - IFPR
  • Foz do Iguaçu - PR
View GitHub Profile
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
public Optional<User> findByUsername(String username);
}
@Entity
@Data
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
programa
{
real total = 0.0
funcao inicio()
{
inteiro opcao = -1
menu()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="container">
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Ubuntu", sans-serif;
@jeffersonchaves
jeffersonchaves / application.properties
Last active June 9, 2025 16:49
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/DATABASE_NAME
#?createDatabaseIfNotExist=true
# &userSSL=false
# &serverTimezone=UTC
# ...
spring.datasource.username=USER
spring.datasource.password=PASSWORD
spring.jpa.hibernate.ddl-auto=update
@jeffersonchaves
jeffersonchaves / dockerfile
Last active July 7, 2025 21:19
dockerfile
FROM ubuntu:latest AS build
RUN apt-get update
RUN apt-get install openjdk-21-jdk -y
COPY . .
RUN apt-get install maven -y
RUN mvn clean install
@jeffersonchaves
jeffersonchaves / php_bank.php
Last active February 6, 2025 10:36
Banco PHP
<?php
//Globais
$clientes = [];
$contas = [];
//Cliente que sempre existe
// $cliente = [
// "nome" => "John Doe",
// "cpf" => "00000000000", //11 digitos
<?php
$pokeNome = readline("informe o pokémon: ");
$url = "https://pokeapi.co/api/v2/pokemon/$pokeNome";
$arquivo = file_get_contents($url);
$pokemon = json_decode($arquivo, true);