[git] “remote: error: refusing to update checked out branch: refs/heads/master” 케이스

By | 8월 25, 2020

좀 멍청한 짓이었는데, intellij 셋팅 후 clone 으로 프로젝트를 받아온 상태에서, 당연히 remote repository 가 clone 주소라고 생각하고 있었는데, remote branch 의 주소가 다름 아닌 local branch 의 주소였던 것이다. 그래서 push가 reject 가 된 것..   remote repository 의 주소를 원격지로 다시 설정하고 push를 하니 문제가 없었다.   (-_- )..    

웹 관련 유틸 클래스 (자작)

By | 8월 13, 2020

  package com.app.util; import java.util.Locale; import java.util.Properties; import javax.servlet.http.HttpServletRequest; import org.springframework.context.MessageSource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PropertiesLoaderUtils; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import com.util.StringUtil; import lombok.extern.slf4j.Slf4j; /** * 웹 관련 유틸 클래스 * * @author STEVE */ @Slf4j public class WebUtil { /** * 현재 request url 에서 [http(s)프로토콜 부터 도메인까지]를 substring 한 문자열을… Read More »

썬더버드(Thunderbird)로 메일건(Mailgun) SMTP서버를 경유하여 Gmail 메일 발송하기

By | 8월 7, 2020

※ 개요: Thunderbird로 gmail의 SMTP 서버를 경유하여 단체메일을 보냈더니, 수신자 100명 제한이 걸려 있어서 찾아보다가 메일건 SMTP 서버를 연결하기로 했다.   1. Mailgun SMTP credential 발급 1-1. Mailgun > Sending > Domain settings > SMTP credentials > New SMTP User   2. Thunderbird 설정 2-1. 계정설정 > 보내는 서버 (SMTP) > 추가 서버 이름: smtp.mailgun.org… Read More »

[링크] 윈도우 화면 위에 마우스로 그림 그리는 프로그램

By | 7월 21, 2020

http://www.presentation-assistant.com/ppointer/index.htm     * 간단 사용법 (마우스로 그림 그리는 것에 한해)   1. Live Draw 탭 클릭 2. Activate 상태가 아니면 Activate 클릭 (아니면 기본 단축키인 Ctrl + F11 로 Activate 시켜도 됨) 3. Activate 상태에서 – Ctrl 을 누른 상태에서 마우스 이동을 하면 선이 그려짐 – 마우스클릭을 하면 안되고 Ctrl을 누른 상태에서 마우스만 이동한다.… Read More »

nginx 설정파일 예시 (php 관련)

By | 5월 29, 2020

* 개요 nginx 버전: 1.18.0 nginx – php 설정을 하는데, 기존 소스가 php 파일임에도 불구하고 html 확장자로 되어 있어서 초기 셋팅에 애를 먹었었다. location / {} 에 fast_cgi 관련 설정을 넣으니 <!DOCTYPE html> 태그가 html 파일에 선언되어 있을 때 css가 작동하지 않았고,  해당 태그를 삭제하니 css가 작동했다. 이 때 fiddler를 통해 좀 더 분석해 보니… Read More »

[링크] [JavaScript/자바스크립트] 숫자를 만, 억, 조, 경 등 만 단위 한글로 찍기 + 자바스크립트 연산의 한계값

By | 5월 27, 2020

https://this-programmer.com/entry/JavaScript%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8-%EC%88%AB%EC%9E%90%EB%A5%BC-%EB%A7%8C-%EC%96%B5-%EC%A1%B0-%EA%B2%BD-%EB%93%B1-%EB%A7%8C-%EB%8B%A8%EC%9C%84-%ED%95%9C%EA%B8%80%EB%A1%9C-%EC%B0%8D%EA%B8%B0-%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8-%EC%97%B0%EC%82%B0%EC%9D%98-%ED%95%9C%EA%B3%84%EA%B0%92      

java 8 의 컬렉션(Map, Set, List…)을 편리하게 순회하는 샘플코드 (forEach, replaceAll, filter, map…)

By | 3월 25, 2021

/* * 기본적인 루프 * – map.forEach() */ map.forEach((k, v) -> System.out.println("key: " + k + ", value: " + v)); map.forEach((k,v) -> { System.out.println("key: " + k + ", value: " + v) }); map.entrySet().forEach((e) -> System.out.println("key: " + e.getKey() + ", value: " + e.getValue())); map.keySet().forEach((k) -> System.out.println("key: " + k)); map.values().forEach((v) ->… Read More »

[자작] MyBatis EHCache 를 필요에 따라 statement 별로 제거하기

By | 4월 29, 2020

import java.util.List; import org.apache.ibatis.cache.CacheKey; import lombok.extern.slf4j.Slf4j; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; /** * MyBatis EHCache 관련 유틸 클래스 * * – mapperId + statementId 에 대하여 exactly equals 가 아니라 contains 임에 주의 * * @author STEVE */ @Slf4j public class MyBatisCacheUtil { /** * MyBatis 쿼리 캐시 제거 * * @param mapperId (e.g. “com.example.repository.UserRepository”) *… Read More »