Skip to content

Instantly share code, notes, and snippets.

View 0OZ's full-sized avatar
:octocat:
= 🐙 + 🐱

Christian 0OZ

:octocat:
= 🐙 + 🐱
View GitHub Profile
@0OZ
0OZ / regex-street.md
Last active June 20, 2024 13:51
Regex for German street names

Regular Expressions

((Ober|Unter den|An |Im |Platz |Berg |Am |Alt\-).+|(?:([A-Z][a-zäüö-]+){1,2})).([Cc]haussee|[Aa]llee|[sS]tr(\.|(a(ss|ß)e))|[Rr]ing|berg|gasse|grund|hörn| Nord|graben|[mM]arkt|[Uu]fer|[Ss]tieg|[Ll]inden|[Dd]amm|[pP]latz|brücke|Steinbüchel|Burg|stiege|[Ww]eg|rain|park|[Ww]eide|[Hh][oö]f|pfad|garten|bogen|passage).+?(\d{1,4})([a-zäöüß]+)?(\-?\d{1,4}[a-zäöüß]?)?

Note: the first letter must be capitalized and there must be a house number

//city with zip code

(?
@0OZ
0OZ / README.md
Last active April 17, 2021 15:02
Kotlin ClassMember

Runner:

how to iterate over all values in a Kotlin classe

data class Property(
  val id: Int,
  val name: String,
)
@0OZ
0OZ / README.md
Last active June 14, 2022 14:39
settings.gradle.kts

versionCatalog

version Catalog example for Gradle with:

  • spring
  • jjwt
  • stripe
  • firebase
  • ...
@0OZ
0OZ / deserialization.kt
Created April 22, 2022 08:55
Deserialization.kt
inline fun <reified T> deserialization(json: String): T =
jacksonObjectMapper().registerKotlinModule().readValue(json) as T
// ---
fun foo(){
val boo = deserialization(message) as Boo
}
@0OZ
0OZ / MongoConfig.kt
Created September 9, 2022 07:18
ZonedDateTimeConvert | Reactive MongoConfig (Kotlin)
@Configuration
class MongoConfig {
@Bean
fun mongoCustomConversions(): MongoCustomConversions {
val converters = listOf(
ZonedDateTimeToDate.INSTANCE,
DateToZonedDateTime.INSTANCE
)
return MongoCustomConversions(converters)
}
@0OZ
0OZ / Dockerfile
Created November 9, 2022 15:01
Docker build example for Spring Boot application with multiply services
FROM gradle:7.4.2-alpine AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
ARG SERVICE
RUN gradle :${SERVICE}:bootJar --no-daemon --stacktrace
#FROM openjdk:11.0.12-jre-slim
FROM adoptopenjdk/openjdk11-openj9:x86_64-alpine-jre-11.0.15_10_openj9-0.32.0
WORKDIR /app
ARG SERVICE
@0OZ
0OZ / .zshrc
Created November 6, 2023 07:08
.zshrc
#my external ip
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
#current bitcoin value
alias bitcoin="telnet ticker.bitcointicker.co 10080"
#resolve domain to ip
alias ip='dig +short'
#lazy k