Skip to content

Instantly share code, notes, and snippets.

View ihoneymon's full-sized avatar

Kim Ji-Heon ihoneymon

View GitHub Profile

20160315 WebJars 사용하기

얼마전까지 프로젝트에서 클라이언트에서 사용되는 웹 라이브러리(jquery, bootstrap) 등에 대한 관리를 제대로 하지 않았다. 화면 개발 및 적용을 다른이에게 맡기고 있었다가 고전적인 방식으로 웹 라이브러리 의존성을 그대로 프로젝트에 추가하여 버전관리시스템에 올라와있는 모습을 보게 되었다. 이렇게 프로젝트의 버전관리에 포함된 웹라이브러리는 버전이 업그레이드되면 버전을 업글하기가 쉽지 않다.

이런 상황을 타개할 수 있는 방법으로 WebJars 를 고려해보게 되었다.

http://www.webjars.org/

webjars 란 무엇인가?

@ihoneymon
ihoneymon / flag_attributes.asc
Created August 25, 2017 14:26
오늘 안드로이드쪽에서 사용되는 기법 하나를 새로이 알게 되었다.
/**
* <a href="https://medium.com/@JakobUlbrich/flag-attributes-in-android-how-to-use-them-ac4ec8aee7d1">Flag Attributes in Android — How to Use Them</a>
* <code>
* attribute="option1|option2"
* </code>
*/
public class FlatAttributesTest {
private final static int TWO = 2;
private final static int FOUR = 4;
private final static int SIX = 6;
@ihoneymon
ihoneymon / bit_flag.asc
Last active August 25, 2017 14:52
오늘 안드로이드쪽에서 사용되는 기법 하나(`Bit flag`)를 새로이 알게 되었다.
@ihoneymon
ihoneymon / kotlin-basic-syntax.asc
Created September 20, 2017 09:50
코틀린 Kotlin 하나식 사용해보기
/**
 * 패키지 정의하기
 * - 소스 상단에 정의한다
 */
package io.honeymon.kotlin.study.syntax

import java.util.*
@ihoneymon
ihoneymon / build.gradle
Last active November 17, 2017 02:17
providedRuntime tomcat
// `build.gradle` for `boot-spring-boot`
plugins {
id 'java'
id 'war'
id 'eclipse'
id 'idea'
id 'org.springframework.boot' version '1.5.8.RELEASE'
id "com.gorylenko.gradle-git-properties" version "1.4.17"
}
@ihoneymon
ihoneymon / pom.xml
Created November 17, 2017 02:25
provided tomcat(embedded servlet container)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.honeymon.springboot.boot</groupId>
<artifactId>boot-spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
package com.jelies.spring3tomcat7.config.quartz;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
/**
* This JobFactory autowires automatically the created quartz bean with spring @Autowired dependencies.
@ihoneymon
ihoneymon / TestConfigurationTest.java
Created January 9, 2018 13:22
`@TestConfiguration` 를 테스트를 위한 내부 클래스로 선언한 예제
```
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestConfigurationTest {
@TestConfiguration
static class InnerTestConfig {
@Bean
RestTemplate restTemplate() {
@ihoneymon
ihoneymon / java_uuid_version.asc
Created February 10, 2018 15:09
아무런 생각없이 사용했던 UUID에는 4가지 형태의 UUID가 있었다.
/**
 * The version number associated with this {@code UUID}.  The version
 * number describes how this {@code UUID} was generated.
 *
 * The version number has the following meaning:
 * <ul>
 * <li>1    Time-based UUID
 * <li>2    DCE security UUID
@ihoneymon
ihoneymon / 20180312-springboot-exitcodegenerator.asc
Last active March 12, 2018 14:03
ExitCodeGenerator, 스프링 부트 애플리케이션을 깔끔하게 종료하며 내뱉을 종료코드

ExitCodeGenerator에 관한 이야기

애플리케이션이 정상적으로 종료되는 것은 꽤 중요하다. 애플리케이션의 갑작스런 죽음과는 달리 특정 상황이 발생했고 그 상황에 맞춰 종료코드를 반환하고 죽는다면 그에 대한 대응하기가 수월해진다. 스프링 부트에서 장애대응을 수월하게 할 수 있도록 특정상황에 따른 종료코드(Exit Code)를 반환하며 애플리케이션을 정상종료 시키는 기능을 제공한다.