Skip to content

Instantly share code, notes, and snippets.

View silentsoft's full-sized avatar

Hyesung Lee silentsoft

View GitHub Profile
@silentsoft
silentsoft / pom.xml
Created March 23, 2020 16:13
How to run webpack build during maven build
<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>webpack build</id>
@silentsoft
silentsoft / shutdown.ps1
Created March 13, 2020 15:42
How to kill process by specific port using Windows PowerShell
$ErrorActionPreference = 'SilentlyContinue'
$ProcessId = (Get-NetTCPConnection -LocalPort 8080).OwningProcess
if ($ProcessId) {
$Process = Get-Process -Id $ProcessId
if ($Process) {
$Process.CloseMainWindow()
Sleep 100
if (!$Process.HasExited) {
Stop-Process -Id $ProcessId -Force
}
@silentsoft
silentsoft / pom.xml
Created March 13, 2020 09:35
How to include system scope dependency using Spring Boot with Maven
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
@silentsoft
silentsoft / CustomNamedParameterJdbcTemplate.java
Created March 13, 2020 09:31
How to log parsed SQL with NamedParameterJdbcTemplate
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.function.Consumer;