This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// static 사용을 제한한 싱글턴 구조의 표현 예제 | |
using System; | |
public class SingletonService | |
{ | |
public string GetMessage() => "Hello World"; | |
} | |
public class ClientModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 스프링 4.3부터 추가된 InjectionPoint를 이용한 Context-Aware Bean 생성 방법. | |
@Configuration | |
public class BeanConfig { | |
@Bean | |
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | |
Logger logger(InjectionPoint injectionPoint) { | |
return LoggerFactory.getLogger(injectionPoint.getMethodParameter().getContainingClass()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.boot; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration; | |
@SpringBootApplication(exclude = ThymeleafAutoConfiguration.class) | |
public class BootApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(AppSecurityApplication.class, args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.controllertest.controller; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
/** | |
* 이 문제의 수동 테스트 결과는 "/path/home" 이다.<br> | |
* 1. 자식클래스의 "path"가 부모 클래스나 인터페이스를 override했기 때문.<br> | |
* 2. 자식클래스 "path"를 제거할 경우 답은 "/if/home" 이다.<br> | |
* 3. 자식 인터페이스 "if"를 제거할 경우 답은 "/superif/home"<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# save this file as tailc then | |
# run as: $ tailc logs/supplier-matching-worker.log Words_to_highlight | |
file=$1 | |
if [[ -n "$2" ]]; then | |
color=' | |
// {print "\033[37m" $0 "\033[39m"} | |
/(WARN|WARNING)/ {print "\033[1;33m" $0 "\033[0m"} | |
/(ERROR|CRIT)/ {print "\033[1;31m" $0 "\033[0m"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.your.project.config; | |
import com.zaxxer.hikari.HikariDataSource; | |
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Primary; | |
import javax.sql.DataSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.bootdemo; | |
import io.swagger.models.parameters.AbstractSerializableParameter; | |
import io.swagger.models.properties.BaseIntegerProperty; | |
import org.junit.jupiter.api.AfterEach; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; | |
import java.io.ByteArrayOutputStream; | |
import java.io.PrintStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; | |
@Configuration | |
public class ThymeleafConfig { | |
@Bean | |
public SpringResourceTemplateResolver thymeleafTemplateResolver( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Querydsl | |
/src/main/generated |
OlderNewer