Skip to content

Instantly share code, notes, and snippets.

Promise vs Observable vs Signal

Quando o assunto é operações assíncronas no Angular, existe uma maneira simples de fazer as coisas -- e várias maneiras complicadas.

Demonstremos com um exemplo. Suponhamos que o seu componentezinho maroto receba um parâmetro/argumento chamado id:

<componente-maroto id=”1” />

Lá dentro, ele pega esse parâmetro, faz uma requisição HTTP e guarda a resposta num atributo. Blz?

@tfga
tfga / colorizeTomcat
Last active June 12, 2023 18:57 — forked from ElMesa/taillog.sh
Colorize logs
#!/usr/bin/env bash
#
# Usage:
#
# catalina.sh run 2>&1 | colorizeTomcat
# tail -200 catalina.out | colorizeTomcat
#
# Previous versions:
#

Why you should switch to Kotlin

  1. Low cost of transition

    • You can continue using Maven (unlike in Scala, where Maven support is really bad and you eventually have to switch to sbt)

    • Kotlin and Java files can co-exist in the same project.

    • In IntelliJ, when you paste Java code into a Kotlin file, the IDE converts the code for you on the fly. (The conversion is not perfect. But, still).