Skip to content

Instantly share code, notes, and snippets.

View appkr's full-sized avatar
🎯
Focusing

appkr appkr

🎯
Focusing
View GitHub Profile
@appkr
appkr / AddressRefiner.java
Last active August 2, 2024 17:15
주소정제기 초벌
package com.vroong.neogeo.support.address.refiner;
import static com.vroong.neogeo.domain.AdditionalInfo.*;
import static com.vroong.neogeo.domain.RegionType.*;
import static com.vroong.neogeo.support.address.Regex.*;
import com.vroong.neogeo.domain.AddressEntry;
import com.vroong.neogeo.domain.AddressEntry.AddressEntryBuilder;
import com.vroong.neogeo.domain.Refinable;
import com.vroong.neogeo.support.address.Regex;
@appkr
appkr / JwtExampleTest.java
Created February 16, 2021 12:26 — forked from gimbimloki/JwtExampleTest.java
JWT Example (Sign, Verify and etc)
package com.nhn.jwt;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.ECDSAKeyProvider;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Maps;
import com.nimbusds.jose.*;
import com.nimbusds.jose.crypto.ECDSASigner;
import com.nimbusds.jose.jwk.Curve;
@appkr
appkr / erd.md
Last active August 6, 2024 18:03
ERD in plantuml

entity entity
1 -
0 or 1 -o|
one and only 1 -||
many -{
0 or many -o{
1 or many -|{
@appkr
appkr / sql.md
Created November 6, 2020 08:16
SQL 합집합, 교집합, 차집합, 대칭차집합
CREATE TABLE tablea (str varchar(8), PRIMARY KEY (str));
CREATE TABLE tableb (str varchar(8), PRIMARY KEY (str));
INSERT INTO tablea (str) VALUES ('A'), ('B'), ('C'), ('D');
INSERT INTO tableb (str) VALUES ('C'), ('D'), ('E'), ('F');
-- 합집합
@appkr
appkr / DatabaseCleaner.java
Last active October 23, 2020 07:42
snippets for Integration Test (Test Isolation)
package ...;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashSet;
@appkr
appkr / Jconsole.md
Last active November 24, 2020 02:14
Jconsole - JVM profiler
$ which jconsole
# /Users/appkr/.jenv/shims/jconsole

$ jconsole

@appkr
appkr / OrderState.java
Created August 19, 2020 13:27
methods in Java Enum
// @see https://github.com/madvirus/ddd-start
public enum OrderState {
PAYMENT_WAITING {
public boolean isShippingChangeable() {
return true;
}
}, PREPARING {
public boolean isShippingChangeable() {
return true;
@appkr
appkr / DatabaseConfiguration.java
Created March 17, 2020 12:50
Spring Database Connection 분리
@Configuration
@EnableJpaRepositories("package.to.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
public class DatabaseConfiguration {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
@Bean
@ConfigurationProperties(prefix = "spring.datasource.hikari.master")
@appkr
appkr / polymorphism.md
Created February 4, 2020 14:42
polymorphism
  • 부모 타입이 사용될 위치에 자식 타입을 사용하는 것
  • 부모 타입 대신 대입된 자식 타입이 재정의(override)한 메서드를 사용함으로써, 어떤 자식 타입이 대입되느냐에 따라서 그 실행 결과가 다양해질 수 있음
public class Foo {
    void doSomething() { /*어떤 동작*/ }
}

public class Bar extends Foo {
    @Override
 void doSomething() { /*다른 동작*/}
@appkr
appkr / Java random.md
Last active January 3, 2020 07:41
Java Random
(int) (Math.random() * A) + B

B 이상 (B + A) 미만의 랜덤 정수


example) 1~6 중 하나의 정수가 나오는 주사위