Skip to content

Instantly share code, notes, and snippets.

View alexaugustobr's full-sized avatar
🤔
0x141A140E6

Alex Alves alexaugustobr

🤔
0x141A140E6
View GitHub Profile
@edurbs
edurbs / DomainEntity.java
Last active January 13, 2024 22:56
Validação de números telefone fixo ou móvel (celular) do Brasil
public interface DomainEntity {
public default void validate() {
new EntityValidatorService().validate(this);
}
}
@up1
up1 / BaseTests.java
Last active September 1, 2023 20:16
Spring Cloud Contract
@SpringBootTest (classes = ProviderApplication.class)
class BaseTests {
@Autowired
private CustomerRestController customerRestController;
@MockBean
private CustomerRepository customerRepository;
@BeforeEach
@sjohnr
sjohnr / Client.java
Last active October 15, 2022 19:05
JpaRegisteredClientRepository
/*
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@DavidCabral
DavidCabral / PixPayload.java
Last active March 18, 2022 19:23
Java PIX estático, geração do QRCODE
/**
* Fonte = https://youtu.be/eO11iFgrdCA
*/
import java.text.DecimalFormat;
public class PixPayload {
private static final String ID_PAYLOAD_FORMAT_INDICATOR = "00";
private static final String ID_POINT_OF_INITIATION_METHOD = "01";
private static final String ID_MERCHANT_ACCOUNT_INFORMATION = "26";
@ramsunvtech
ramsunvtech / nginx-micro-frontend-config.conf
Created January 10, 2021 10:49
Nginx Microfrontend Configuration
server {
ssi on;
proxy_intercept_errors on;
location /product-list {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@rponte
rponte / using-uuid-as-pk.md
Last active July 11, 2024 21:07
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@ourownstory
ourownstory / encrypted_dual_boot_xps_17.md
Last active June 19, 2024 13:58
Encrypted dual boot setup for Pop!_OS and Windows 10 using LUKS and Bitlocker on Dell XPS 17 9700

Encrypted dual boot setup with Pop!_OS and Windows 10

How to guide, using LUKS and Bitlocker on Dell XPS 17 9700

This guide is for those who want to use their XPS 17 in dual boot with their (preinstalled) Windows 10 and a new Pop!_OS installation, without giving up Bitlocker Encryption in Windows nor LUKS encryption in Linux.

The only guides that I could find were for Ubuntu, which it should be identical to, but I found the ommission of a few steps to resolve issues that I encountered in my first install attempt. Hoping to save you some trouble, I am sharing the steps that worked for me, linking the original guides that I found useful.

1. Preparation

  • 1.1 Of course: Backup all your data! You always do this when people tell you to, right? Maybe this time better be safe than sorry.
  • 1.2 Safely note your Bitlocker recovery key somewhere off your XPS. Where to find it
  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04 -> 21.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@luisfelipeas5
luisfelipeas5 / SonarQubeREADME.md
Last active February 6, 2024 12:27
Um guia para configurar o básico do SonarQube + Jacoco

Adicione o plugin do SonarQube

Primeiro, adicione ao build.gradle de nível de projeto:

buildscript {
   repositories {
       //...
       maven {
           url "https://plugins.gradle.org/m2/"
       }
@MerNat
MerNat / gist:8ee69c5eeaa4ac909b0044f48e9569b0
Last active October 29, 2023 13:07
Traefik docker compose yml for cluster or swarm configuration.
version: '3.4'
services:
consul-leader:
image: consul
command: agent -server -client=0.0.0.0 -bootstrap -ui
volumes:
- consul-data-leader:/consul/data
environment:
- CONSUL_BIND_INTERFACE=eth0