Skip to content

Instantly share code, notes, and snippets.

View onlyeat3's full-sized avatar
🚩
不减20斤不改状态

onlyeat3 onlyeat3

🚩
不减20斤不改状态
View GitHub Profile
@onlyeat3
onlyeat3 / service.sh
Created July 8, 2019 09:08
restart spring boot jar
#!/bin/bash
## Author LinkinStar,liuyuyu
## UPDATE 2019-01-05
version="1.0.1";
jarName=$2
appName=jarName
apolloMeta=http://172.20.5.103:8080
projectDir=/home/liuyuyu/data/web/$jarName
@onlyeat3
onlyeat3 / pom.xml
Last active July 11, 2019 01:43
在自定义文件中启用maven内置变量,需要额外处理
这些配置是可继承的,如果是多模块项目,放到父工程即可
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
@onlyeat3
onlyeat3 / .properties
Created May 21, 2019 00:58
@ControllerAdvice handle all exception
spring.mvc.throw-exception-if-no-handler-found=true
spring.resources.add-mappings=false
@onlyeat3
onlyeat3 / jdk-http-server
Created June 20, 2018 07:45
simple-benchmarking
import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import lombok.Data;
import org.junit.Test;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
List<Class<?>> validAnnotationList = new ArrayList<>();
validAnnotationList.add(RequestMapping.class);
List<Object> controllerList = new ArrayList<>();
controllerList.addAll(this.applicationContext.getBeansWithAnnotation(Controller.class).values());
List<SysResource> resourceEntityList = new ArrayList<>();
AtomicLong id = new AtomicLong();
for (Object controller : controllerList) {
Class<?> clazz = controller.getClass();
@onlyeat3
onlyeat3 / gist:6de413fbd7de440d1a940dd062220660
Created August 24, 2017 03:04
maven 升级版本号命令
mvn versions:set -DnewVersion=2.0.0-SNAPSHOT
@onlyeat3
onlyeat3 / A.java
Created August 16, 2017 04:52
获取lambda表达式的元信息
@FunctionalInterface
public interface A<T, R> extends Function<T, R>, Serializable {
}