Skip to content

Instantly share code, notes, and snippets.

View TheMartinfer22's full-sized avatar
2024 code based

Martin Hartfelder TheMartinfer22

2024 code based
View GitHub Profile
@TheMartinfer22
TheMartinfer22 / create-zip-upload-release.yml
Created July 5, 2022 19:26
Github Actions script para arquivar tudo em um zip e upar ele criando uma release ou sobrescrevendo a tag latest
name: "release"
on:
push:
branches:
- "main"
jobs:
pre-release:
name: "Release"
runs-on: "ubuntu-latest"
steps:
@TheMartinfer22
TheMartinfer22 / ConvertExamplesToYourType.java
Last active March 18, 2022 12:53
Para utilizar esse código deve conter o arquivo que irá realizar a verificação, isso é útil para verificar e alterar os campos se caso estiverem em seu formato incorreto
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class CSUParseAttributes {
public static void main(String[] args) throws IOException {
@TheMartinfer22
TheMartinfer22 / CompareAWSAndModelWithExamples.java
Created March 18, 2022 12:48
Para utilizar essa ferramenta deve conter o arquivo export da AWS em formato OpenAPI 3.0.1 e o arquivo contendo os examples e descriptions de origem para poder unificar, isso irá servir para solucionar o problema de inserção de examples na AWS e para facilitar a documentação.
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class HashUtils {
public String hash(String input) throws NoSuchAlgorithmException {
MessageDigest hash = MessageDigest.getInstance("SHA-1");
hash.update(input.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();