This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script th:inline="javascript"> | |
/*<![CDATA[*/ | |
console.log(/*[[${myVariable.id}]]*/ 'default'); | |
/*]]>*/ | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public String toString() { | |
return Character.toUpperCase(name().charAt(0)) + name().toLowerCase().substring(1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Bootstrap CSS --> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous"> | |
<title>Thymeleaf and Bootstrap</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" class="form-control" th:value="${#dates.format(#dates.createNow() , 'yyyy/MMM/dd_HH-mm-ss')}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for each 1 | |
for(Mensagem mensagem : mensagens){ | |
System.out.println(mensagem); | |
} | |
// for each 2 - Utilizando função | |
mensagens.forEach(mensagem -> { | |
System.out.println(mensagem); | |
}); | |
// for each 3 | |
mensagens.forEach(System.out::println); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items => { | |
items.sort((a, b) => a.id < b.id ? -1 : a.id === b.id ? 0 : 1); | |
// If you need your sort to work with accented characters use: | |
a.nome.localeCompare(b.nome) | |
// instead of | |
a.nome < b.nome ? // ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GetMapping(value = "/foo") | |
@ResponseBody | |
public ResponseEntity<List<YourEnum>> listYourEnum() { | |
return new ResponseEntity<List<YourEnum>>(Arrays.asList(YourEnum.values()), HttpStatus.OK); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adicionar ao final do C:/eclipse/eclipse.ini: | |
--illegal-access=warn | |
--add-opens java.base/java.lang=ALL-UNNAMED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT c.conname AS constraint_name, | |
c.contype AS constraint_type, | |
sch.nspname AS "self_schema", | |
tbl.relname AS "self_table", | |
ARRAY_AGG(col.attname ORDER BY u.attposition) AS "self_columns", | |
f_sch.nspname AS "foreign_schema", | |
f_tbl.relname AS "foreign_table", | |
ARRAY_AGG(f_col.attname ORDER BY f_u.attposition) AS "foreign_columns", | |
pg_get_constraintdef(c.oid) AS definition | |
FROM pg_constraint c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Eliminar os exclusivos idem uma matriz | |
arr.filter((v,i,a)=>a.findIndex(t=>(t.id === v.id))===i) | |
// Eliminar por várias propriedades ( placee name) | |
arr.filter((v,i,a)=>a.findIndex(t=>(t.place === v.place && t.name===v.name))===i) | |
// Eliminar por todas as propriedades (isso será lento para matrizes grandes) | |
arr.filter((v,i,a)=>a.findIndex(t=>(JSON.stringify(t) === JSON.stringify(v)))===i) | |
// Manter a última ocorrência |
OlderNewer