Skip to content

Instantly share code, notes, and snippets.

View ThiagoBfim's full-sized avatar

Thiago ThiagoBfim

View GitHub Profile
@wpik
wpik / MongoConvertersConfig.java
Last active September 15, 2023 14:56
OffsetDateTime converters in Mongo in Spring
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.List;
@Configuration
@nghiaht
nghiaht / generate_rsa_keypair.sh
Created September 13, 2018 03:30
Generate RSA keypair (public, private + pkcs8) using openssl command
# Private key
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
# Public key
openssl rsa -pubout -in private.pem -out public_key.pem
# Private key in pkcs8 format (for Java maybe :D)
openssl pkcs8 -topk8 -in private.pem -out private_key.pem
## nocrypt (Private key does have no password)
@FedericoPonzi
FedericoPonzi / big-o-java-collections.md
Last active December 30, 2023 18:05
Big O notation for java's collections

The book Java Generics and Collections has this information (pages: 188, 211, 222, 240).

List implementations:

                      get  add  contains next remove(0) iterator.remove
ArrayList             O(1) O(1) O(n)     O(1) O(n)      O(n)
LinkedList O(n) O(1) O(n) O(1) O(1) O(1)