Skip to content

Instantly share code, notes, and snippets.

View cmicat's full-sized avatar

cmicat

  • DiDi(China) Technology Co.,Ltd
View GitHub Profile
@cmicat
cmicat / TestFoo.java
Created August 15, 2017 09:25 — forked from msakamoto-sf/TestFoo.java
Nested Test Cases with TestNG (nearly equals JUnit's "Enclosed" TestRunner)
// "(root)/t1/TestFoo.java"
package t1;
import static org.testng.Assert.*;
import org.testng.annotations.*;
public class TestFoo {
static void log(Class k, String mes) {
System.out.println(Thread.currentThread() + " - " + k.toString() + " - " + mes);
}
@cmicat
cmicat / .bashrc
Last active February 17, 2017 11:28
mingw常用sh
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.2-4
# ~/.bashrc: executed by bash(1) for interactive shells.
@cmicat
cmicat / BeanConfig.java
Last active February 12, 2017 07:18
Spring MVC log uncaught Throwable and return error message json
package com.cmicat.lanVideoServer.spring;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
/**
* Created by cmicat on 2017/2/12.
*/
@cmicat
cmicat / StringBuilder.java
Created February 10, 2017 08:27
增加了appendFormat的StringBuilder
package com.cmicat.lanVideoServer.util;
import java.util.Formatter;
import java.util.FormatterClosedException;
import java.util.IllegalFormatException;
import java.util.Locale;
/**
* 整合了 {@link java.lang.StringBuilder} 和 {@link Formatter}的功能。
* 给 {@link java.lang.StringBuilder } 加上了 appendFormat 函数