Skip to content

Instantly share code, notes, and snippets.

View jeonguk's full-sized avatar
🎯
Focusing

jeonguk jeonguk

🎯
Focusing
View GitHub Profile
@jeonguk
jeonguk / ScannerReadTest.java
Created January 10, 2018 06:53
java scanner file read
package com.jeonguk;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@jeonguk
jeonguk / RedisConfig.java
Last active January 10, 2018 06:54
Spring - Embeded Redis configuration
package com.jeonguk.web.config;
import static java.util.stream.Collectors.joining;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
@jeonguk
jeonguk / git_remote_url_change.txt
Last active January 12, 2018 06:34
git remote url change
기존 원격 저장소 URL을 변경하기 위해 git remote set-url 명령어를 사용
$ git remote -v
# View existing remotes
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
$ git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL
@jeonguk
jeonguk / nodejs_gitignore.txt
Created January 12, 2018 14:07
nodejs .gitignore file
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
@jeonguk
jeonguk / .bash_profile
Created January 15, 2018 04:56
bash_profile
alias ll='ls -al'
alias ls='ls -FG'
alias cls='clear'
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
@jeonguk
jeonguk / docker-compose.yml
Created January 15, 2018 12:32
docker-compose.yml
version: '2.1'
services:
book-search-mysql:
image: mysql:5.7
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
container_name: book-search-mysql
healthcheck:
test: "exit 0"
ports:
@jeonguk
jeonguk / spring-security-session-with-redis.txt
Created January 17, 2018 01:21
spring security session with redis
1. pom.xml
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>
2. SessionConfig.java
@jeonguk
jeonguk / deploy.sh
Created January 19, 2018 01:06
spring boot : git pull source -> aws ec2 -> deploy shell script
#!/bin/bash
REPOSITORY=/home/ec2-user/app/git
cd $REPOSITORY/springboot-webservice/
echo "> Git Pull"
git pull
@jeonguk
jeonguk / git_local_file_delete_undo.txt
Created January 21, 2018 04:54
git local delete undo
pull 로컬 변경 사항을 덮어 쓰게하고 작업 트리가 깨끗한 것처럼 병합하려면 작업 트리를 정리.
git reset --hard
git pull
@jeonguk
jeonguk / FibonaciSequenceTest.java
Created January 29, 2018 01:17
Fibonacci Sequence in iterative and functional style
import java.util.stream.IntStream;
import java.util.stream.Stream;
public class FibonaciSequenceTest {
public static void main(String[] args) {
IntStream fibonacciStream = Stream.iterate(
new int[] { 1, 1 },
fib -> new int[] { fib[1], fib[0] + fib[1] }