Skip to content

Instantly share code, notes, and snippets.

View wicksome's full-sized avatar
๐Ÿช
programming happily everyday

yeongjun.kim wicksome

๐Ÿช
programming happily everyday
View GitHub Profile
@wicksome
wicksome / BO.java
Last active February 15, 2019 09:47
Create result to Map or Grouping in Mybatis
@Slf4j
@Service
public class TestBO {
@Autowired
private Mapper mapper;
public static void main(String[] args) {
final List<Integer> ids = new ArrayList<>();
// init ids...
@wicksome
wicksome / highlight.js
Created January 17, 2019 14:27
highlight method(case insensitive, escape, etc...)
export const escapeHtml = string => string.replace(/[&<>"'/`=]/g, s => ({
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
"\"": "&quot;",
"'": "&#39;",
"/": "&#x2F;",
"`": "&#x60;",
"=": "&#x3D;",
})[s]);
@wicksome
wicksome / RadioWithRouter.vue
Created December 20, 2018 11:21
Bind router state to the radio button in vue
<template>
<input
:checked="$route.name === 'groups'"
type="radio"
@change="$router.push({name: 'groups'})"
>
<input
:checked="$route.name === 'groups-member'"
type="radio"
@change="$router.push({name: 'groups-member'})"
@wicksome
wicksome / tree1.js
Last active January 22, 2019 05:19
create tres structure
// sorted data
var resData = [
{ id: "1", level: 1 },
{ id: "2", level: 1 },
{ id: "2-1", level: 2 },
{ id: "2-1-1", level: 3 },
{ id: "2-2", level: 2 },
{ id: "3", level: 1 },
{ id: "3-1", level: 2 },
{ id: "3-1-1", level: 3 },
@wicksome
wicksome / simple.test.js
Created September 14, 2018 10:02
Simple Test Case Code
const TEST = {};
function assertEquals(expected, actual) {
if (expected !== actual)
throw new Error(
`Not equals.\nExpected :${expected}[39m\nActual :${actual}`
);
}
function RunAllTest() {
@wicksome
wicksome / JacksonWithValueAndBuilderOfLombokTest.java
Last active August 7, 2018 11:09
lombok(Value, Builder) + jackson
@Value
@Builder
class ValueTest1 {
private String data1;
private Integer data2;
private int data3;
@JsonCreator
private ValueTest1(@JsonProperty("data1") String data1, @JsonProperty("data2") Integer data2, @JsonProperty("data3") int data3) {
this.data1 = data1;
@wicksome
wicksome / git_find_branches
Last active July 2, 2018 00:46
Find git branches from sub directories
#!/bin/bash
function git_find_branches()
{
if [[ -z "$1" ]]; then
echo "Usage: $FUNCNAME <branch>" >&2
return 1
fi
if [[ -z "$2" ]]; then
@wicksome
wicksome / test.puml
Last active September 20, 2017 03:42
test
Bob -> Alice : hello
Alice -> Bob : Go Away
@wicksome
wicksome / pipp.simpleflash.md
Created February 10, 2017 02:04
๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ๋ฐฉ์นจ-SimpleFlash

๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ๋ฐฉ์นจ

Personal Information Processing Policy

Simple Flash ๊ฐœ์ธ์ •๋ณด ์ฒ˜๋ฆฌ๋ฐฉ์นจ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์‚ฌ์šฉ๋˜๋Š” ํšŒ์›๋‹˜์˜ ๊ฐœ์ธ์ •๋ณด๋Š” ์„œ๋น„์Šค์˜ ์›ํ™œํ•œ ์ œ๊ณต์„ ์œ„ํ•˜์—ฌ ํšŒ์›๋‹˜์ด ์–ดํ”Œ์˜ ์‚ฌ์šฉ๋ชฉ์  ๋ฒ”์œ„ ๋‚ด์—์„œ๋งŒ ์ด์šฉ๋ฉ๋‹ˆ๋‹ค. ๋ฒ•๋ น์— ์˜ํ•˜๊ฑฐ๋‚˜ ๋ณ„๋„๋กœ ๋™์˜ํ•˜์ง€ ์•Š์€ ํ•œ ํšŒ์›๋‹˜์˜ ๊ฐœ์ธ์ •๋ณด๋ฅผ ์ œ3์ž์—๊ฒŒ ์ œ๊ณตํ•˜๋Š” ์ผ์€ ๊ฒฐ์ฝ” ์—†์œผ๋ฏ€๋กœ ์•ˆ์‹ฌํ•˜์…”๋„ ์ข‹์Šต๋‹ˆ๋‹ค.

ํ•ด๋‹น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋‚ด์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ ‘๊ทผ ๊ถŒํ•œ์„ ์‚ฌ์šฉ์ž์—๊ฒŒ ์š”๊ตฌํ•ฉ๋‹ˆ๋‹ค.

@wicksome
wicksome / ShortestPaths.java
Last active October 30, 2015 15:35
Implementation of Dijkstra Shortest Paths in Java.
package kr.opid.algorithm;
import java.util.ArrayList;
import java.util.Stack;
/**
* @author Yeong-jun
*
*/
public class ShortestPaths {