Skip to content

Instantly share code, notes, and snippets.

Clase ¿Qué representa? ¿Es necesario manejarla o declararla? ¿Quién las lanza principalmente?
Throwable La clase raíz de todas las excepciones y errores. No, es la clase base. JVM o el programador.
Error Errores graves que normalmente son de la JVM y no se deben manejar. No, no se deben manejar. JVM (ej. OutOfMemoryError, StackOverflowError).
Exception Excepciones que el programa puede y debe manejar. Sí, si es una excepción comprobada (checked). Programador (ej. IOException, SQLException).
RuntimeException Errores de ejecución que son excepciones no comprobadas. No, son no comprobadas (unchecked). Programador (ej. NullPointerException, ArithmeticException).

Show certificate from server:

openssl s_client -connect some_host:443

Download certificate from server:

keytool -printcert -rfc -sslserver :443 > cert.pem

git init

git add .

git commit -m "Initial commit"

git tag 1.0.0

git switch -c develop

Alias for git add, git commit and git push

Add & commit

git config --global alias.ac "!git add -A && git commit -m "

git ac "my commit"

FLYWAY EXERCISES

1. Initial database creation and initial values

V1__create_database.sql:

CREATE TABLE persons (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100) NOT NULL,

ngrok

brew install --cask ngrok

After login at https://dashboard.ngrok.com/, get your token.

ngrok config add-authtoken

The following message is showed: Authtoken saved to configuration file: ~/Library/Application Support/ngrok/ngrok.yml

@Entity
@Cacheable
public class OrderEntity extends PanacheEntityBase {
@Id
@SequenceGenerator(allocationSize = 1,name = "orderEntitySequence", schema = "public", sequenceName = "order_entity_seq")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "orderEntitySequence")
@Column(name = "id", nullable = false)
public Long id;
@serrodcal
serrodcal / launch.json
Created February 15, 2024 21:24
launch.json for debugging WSO2 MI from VSCode
// path: .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach)",
"projectName": "WSO2 MI 4.2.0",
"request": "attach",
"hostName": "localhost",

Certificate troubleshooting

openssl s_client -connect some_host:443

mixin Electric {
double _batteryCapacity = 0.0, _battery = 0.0;
void engineStart() {
assert(_battery > 0.05, 'No _battery, please charge');
_battery -= (_battery * 0.05);
}
void charge(double energy) {
assert(energy > 0, 'Energy cannot be less than or equal to 0');