Skip to content

Instantly share code, notes, and snippets.

@stoneshim
stoneshim / funcname.go
Created June 16, 2021 08:56
golang get function name
import (
"runtime"
"strings"
)
func FuncName() string {
pc := make([]uintptr, 15)
n := runtime.Callers(2, pc)
frames := runtime.CallersFrames(pc[:n])
frame, _ := frames.Next()
@stoneshim
stoneshim / HashMapTest.java
Created October 20, 2018 14:29
HashMap junit test
import org.junit.Before;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
@stoneshim
stoneshim / ArrayListTest.java
Created October 20, 2018 10:55
ArrayList junit test
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
@stoneshim
stoneshim / hamcrestTest.java
Created October 20, 2018 04:50
hamcrest test sample
import org.junit.Test;
import java.util.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
public class hamcrestTest {
@Test
@stoneshim
stoneshim / .vimrc
Created February 28, 2017 13:37 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on