Skip to content

Instantly share code, notes, and snippets.

View lynas's full-sized avatar

Md Sazzad Islam lynas

View GitHub Profile
@lynas
lynas / spring-read-prop-as-map.md
Created September 5, 2024 10:27
Read value from application.yml as map

application.yml

app:
  vendor:
    port:
      ABL: 8300
      MENEKIS: 5050

Spring

@lynas
lynas / SpringRestClientLog.kt
Created July 8, 2024 13:55
Log request url before making api call
fun getSomething(
param1: String
): ResponseObj? {
return restClient
.get()
.uri(
"/someUrl/{param1}",
param1
)
.httpRequest {
@SpringBootApplication
class Application{
@Bean
fun runner() = CommandLineRunner{
println("Hello World")
}
}
@lynas
lynas / hibernateLog.MD
Last active March 11, 2024 08:41
Spring hibernate log hibernate with query param

application yaml (spring 3 hibernate 6)

spring:
  jpa:
    show-sql: true
logging:
  level:
    org.hibernate.orm.jdbc.bind: trace
<html>
<head>
<style>
#container {
background-color: #FFFFFF;
}
.arrow {
position: absolute;
top: 10%;
01711190994
01730184929
01711378443
01716409799
01711042160
01711468431
01818472880
01743611407
01729685545
01817015379
@lynas
lynas / BootJarWithExternalConfig
Created November 27, 2019 10:33
Run boot jar with external config application.properties
❯ java -jar build/libs/demo-0.0.1-SNAPSHOT.jar --spring.config.location=file:///tmp/application.properties [16:31:02]
@lynas
lynas / JarWithProperties
Created November 27, 2019 10:22
Run boot jar with properties
❯ java -jar build/libs/demo-0.0.1-SNAPSHOT.jar --server.port=8871 [16:18:37]
@lynas
lynas / editFileWithCat.sh
Created November 4, 2019 10:21
edit file with cat. will replace existing content of the file
cat -> fileName.txt
@lynas
lynas / SpringCommandLineRunner.java
Created October 18, 2019 09:28
Spring Command Line Runner JAVA Kotlin
@Bean
public CommandLineRunner init() {
return args -> {
};
}
@Bean
fun init() = CommandLineRunner {