Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
WAIT_HOST=$1
WAIT_PORT=$2
WAIT_LOOP=60
WAIT_DELAY=1
function is_healthy () {
host=$1
port=$2
@hyeonjae
hyeonjae / AppTests.java
Last active January 12, 2017 05:51
spring annotation method argument performance issue test
@Before
public void setup() throws Exception {
this.mockMvc = webAppContextSetup(this.wac).build();
// warm up
for (int i = 0; i < 3000; i++) {
this.mockMvc.perform(post("/")
.contentType(MediaType.APPLICATION_JSON)
.header("Dooray-App-Key", UUID.randomUUID().toString()))
.andExpect(status().isOk())
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class JsonNodeParser {
private final String DOT = ".";
@hyeonjae
hyeonjae / md5.swift
Created June 1, 2015 02:33
MD5 standalone in Swift 1.2
/*
* http://rosettacode.org/wiki/MD5/Implementation#Swift
* https://github.com/krzyzanowskim/CryptoSwift/tree/master/CryptoSwift
* MD5 - no need to external library version
*/
import Foundation
let shift : [UInt32] = [7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21]
let table: [UInt32] = (0 ..< 64).map { UInt32(0x100000000 * abs(sin(Double($0 + 1)))) }