Skip to content

Instantly share code, notes, and snippets.

😀

Ikhun Um ikhoon

😀
View GitHub Profile
@ikhoon
ikhoon / ikhoon.postfixTemplates
Last active Mar 21, 2020
custom postfix template
View ikhoon.postfixTemplates
## Templates for guava ##
.toList : convert to ImmutableList
java.util.stream.Stream -> $expr$.collect(com.google.common.collect.ImmutableList.toImmutableList())
@ikhoon
ikhoon / DATAFrameErrorStack.java
Last active Jan 30, 2020
java.lang.IllegalStateException: cannot start a new stream
View DATAFrameErrorStack.java
"armeria-common-worker-nio-2-1@4812" daemon prio=5 tid=0x17 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at com.linecorp.armeria.internal.Http2ObjectEncoder.doWriteData(Http2ObjectEncoder.java:93)
at com.linecorp.armeria.internal.HttpObjectEncoder.writeData(HttpObjectEncoder.java:85)
at com.linecorp.armeria.server.HttpResponseSubscriber.write(HttpResponseSubscriber.java:298)
at com.linecorp.armeria.server.HttpResponseSubscriber.onNext(HttpResponseSubscriber.java:227)
at com.linecorp.armeria.server.HttpResponseSubscriber.onNext(HttpResponseSubscriber.java:58)
at com.linecorp.armeria.common.stream.DefaultStreamMessage.notifySubscriberWithElements(DefaultStreamMessage.java:341)
at com.linecorp.armeria.common.stream.DefaultStreamMessage.notifySubscriber0(DefaultStreamMessage.java:319)
at com.linecorp.armeria.common.stream.DefaultStreamMessage.doRequest(DefaultStreamMessage.java:188)
@ikhoon
ikhoon / Functors.scala
Created Jan 13, 2020
functor expamles
View Functors.scala
package category
import java.util.concurrent.CompletableFuture
object Functors {
// Monad 핵심: 많이 쓰인다.
// A => B, F[A] => (A => B), => F[B]
// Map Pair(A, B)
// type class, 특정 타입에 기반된 행위
View json-unit-dep.tree
org.hamcrest:hamcrest:2.1
variant "default" [
org.gradle.status = release (not requested)
]
org.hamcrest:hamcrest:2.1
\--- org.awaitility:awaitility:4.0.1
\--- allDependencies (requested org.awaitility:awaitility)
org.hamcrest:hamcrest-core:1.3
@ikhoon
ikhoon / lambdainstance.java
Created Sep 30, 2019
Check java lambda instance is singleton.
View lambdainstance.java
String foo() {
return "abc";
}
String foo(Supplier<String> s) {
System.out.println(s);
return "abc " + s.get();
}
@Test
@ikhoon
ikhoon / checkout-pr.zsh
Last active Oct 7, 2019
git checkout remote pull request to local branch and track it with FZF-TMUX
View checkout-pr.zsh
# git checkout remote pull request to local branch and track it with FZF-TMUX
# Requirements:
# - hub : https://github.com/github/hub
# - fzf-tmux : https://github.com/junegunn/fzf#fzf-tmux-script
pr() {
local pr_list pr_id origin branch_name
pr_list=$(cat /dev/null | hub pr list -f "%pC%>(8)%i%Creset %t @%au %l%n")
result=$?
if [[ $pr_list == *"github.com username:"* ]]; then
echo "Please run 'hub pr list' to login GitHub"
View newmac.sh
#!/bin/bash
# zsh
echo "Installing zsh..."
chsh -s `which zsh`
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# homebrew, pip
echo "Installing homebrew, pip..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@ikhoon
ikhoon / reactive-stream-example.scala
Last active May 3, 2018
Reactive Stream을 활용 예제
View reactive-stream-example.scala
import org.reactivestreams.{Processor, Publisher, Subscriber, Subscription}
// 데이터 생성
val publisher = new Publisher[Int] {
def subscribe(s: Subscriber[_ >: Int]) = {
(1 to 100).foreach { x =>
s.onNext(x)
}
s.onComplete()
}
View scala-fp-books.md
You can’t perform that action at this time.