Skip to content

Instantly share code, notes, and snippets.

View jeonguk's full-sized avatar
🎯
Focusing

jeonguk jeonguk

🎯
Focusing
View GitHub Profile
@jeonguk
jeonguk / vimrc-configtxt
Last active August 23, 2018 15:07
vimrc config
"=== INDENT ===
set autoindent
set cindent
set smartindent
set tabstop=4
set shiftwidth=4
"=== VIEW ===
set visualbell
set number
@jeonguk
jeonguk / command.md
Created July 14, 2018 13:50
Disable “LF will be replaced by CLRF” warning in Git on Windows

warning: LF will be replaced by CRLF in www/index.html. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in www/templates/dash.html. The file will have its original line endings in your working directory.

git config --global core.safecrlf false

@jeonguk
jeonguk / .bash_profile
Created March 6, 2018 10:03 — forked from KennethanCeyer/.bash_profile
bash_profile for MAC users
#.bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#============================================================
#
# ALIASES AND FUNCTIONS
# Arguably, some functions defined here are quite big.
# If you want to make this file smaller, these functions can
@jeonguk
jeonguk / CollectTest.java
Created January 29, 2018 07:55
Java 8 Collect Example
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class CollectTest {
public static void main(String[] args) {
List<User> userList = new ArrayList<>();
userList.add(new User("Tom", 45, 7000.00));
userList.add(new User("Harry", 25, 10000.00));
@jeonguk
jeonguk / ReduceTest.java
Last active January 29, 2018 07:54
Java 8 Reduce Example
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
public class ReduceTest {
static List<User> userList = Arrays.asList(
new User("Tom", 45, 7000.00),
new User("Harry", 25, 10000.00),
new User("Ethan", 65, 8000.00),
@jeonguk
jeonguk / ParallelStreamTest.java
Created January 29, 2018 04:12
Java 8 Parallel Streams Test
import java.util.ArrayList;
import java.util.List;
public class ParallelStreamTest {
public static void main(String[] args) {
long t1, t2;
List<Book> bList = new ArrayList<>();
@jeonguk
jeonguk / Factorial.java
Created January 29, 2018 01:21
Factorial in iterative and functional style
public long factorial(int n) {
return LongStream.rangeClosed(1, n)
.reduce((a, b) -> a * b)
.getAsLong();
}
@jeonguk
jeonguk / isPrime.java
Created January 29, 2018 01:19
Prime Number in functional style
public boolean isPrime(long number) {
return number > 1 && LongStream.rangeClosed(2, (long)Math.sqrt(number))
.noneMatch(index -> number % index == 0);
}
@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] }
@jeonguk
jeonguk / git_local_file_delete_undo.txt
Created January 21, 2018 04:54
git local delete undo
pull 로컬 변경 사항을 덮어 쓰게하고 작업 트리가 깨끗한 것처럼 병합하려면 작업 트리를 정리.
git reset --hard
git pull