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
-Dspring.output.ansi.enabled=ALWAYS |
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 Spring Applications use JAVA_TOOL_OPTIONS enviroment. | |
-XX:MaxRAMPercentage=75 | |
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
sealed class Shape permits Circle, Rectangle { | |
double getArea() { | |
return switch(this) { | |
case Circle(double r) -> Math.PI * r * r; | |
case Rectangle(double h, double w) -> h * w; | |
} | |
} | |
} |
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
logging: | |
pattern: | |
console: "%clr(%d{HH:mm:ss.SSS}){blue} %clr(---){cyan} %clr([%15.15t]){yellow} %clr(:){red} %clr(%m){magenta}%n" |
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
# kubectl | |
cd /usr/local/bin/ | |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x kubectl | |
cd - | |
#kind | |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64 | |
chmod +x ./kind |
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
import java.util.*; | |
import java.util.stream.Collectors; | |
public class Main { | |
public static void main(String[] args) { | |
Peca[] pecas = new Peca[7]; | |
pecas[0] = new Peca(1, new Cor[]{Cor.BRANCO, Cor.AZUL, Cor.VERDE, Cor.AMARELO, Cor.VERMELHO, Cor.LARANJA}); | |
pecas[1] = new Peca(2, new Cor[]{Cor.BRANCO, Cor.VERDE, Cor.VERMELHO, Cor.AMARELO, Cor.AZUL, Cor.LARANJA}); | |
pecas[2] = new Peca(3, new Cor[]{Cor.BRANCO, Cor.VERMELHO, Cor.AMARELO, Cor.LARANJA, Cor.VERDE, Cor.AZUL}); | |
pecas[3] = new Peca(4, new Cor[]{Cor.BRANCO, Cor.AZUL, Cor.VERMELHO, Cor.LARANJA, Cor.VERDE, Cor.AMARELO}); |
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
docker inspect --format "{{json .State.Health }}" <container-name> |
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
echo $CI_COMMIT_REF_NAME | awk -v t=$TAG -F _ '{ if (t == $AMBIENTE) { print "ambientex" } else { print tolower($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
public class ListenerSample { | |
// Adjust the header name if required, on @Header parameter | |
@RabbitListener(queues = "q.finance.invoice") | |
public void listenInvoiceCreated(@Payload String message, @Header(AmqpHeaders.DELIVERY_TAG) long tag, | |
@Header("type") String type) throws IOException { | |
if (StringUtils.equalsIgnoreCase(type, "invoice.paid")) { | |
log.info("Delegate to invoice paid handler"); | |
} else if (StringUtils.equalsIgnoreCase(type, "invoice.created")) { | |
log.info("Delegate to invoice created handler"); |
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
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.amqp.core.Message; | |
import org.springframework.amqp.rabbit.annotation.RabbitHandler; | |
import org.springframework.amqp.rabbit.annotation.RabbitListener; | |
import org.springframework.stereotype.Service; | |
import com.course.finance.message.invoice.InvoiceCreatedMessage; | |
import com.course.finance.message.invoice.InvoicePaidMessage; |
NewerOlder