Skip to content

Instantly share code, notes, and snippets.

View vector4wang's full-sized avatar
🕶️
For Freedom!

wangxc vector4wang

🕶️
For Freedom!
View GitHub Profile
@vector4wang
vector4wang / node.java
Last active August 1, 2019 01:36
[Java ExecutorService 运行指定时间后停止] #Java #线程
ExecutorService es = Executors.newFixedThreadPool(10);
es.execute(new Thread());//执行子线程任务
try {
es.shutdown();
if(!es.awaitTermination(20,TimeUnit.SECONDS)){//20S
System.out.println(" 到达指定时间,还有线程没执行完,不再等待,关闭线程池!");
es.shutdownNow();
}
} catch (Throwable e) {
// TODO Auto-generated catch block
@vector4wang
vector4wang / maven-checkstyle-plugin.xml
Created July 28, 2019 08:06
[Maven 打包最佳实践] #Maven #pom
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
@vector4wang
vector4wang / centos-install.md
Last active July 29, 2019 06:27
[selenium 常用命令] #selenium #

安装Chrome

# 指定yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# 下载并安装
curl https://intoli.com/install-google-chrome.sh | bash
ldd /opt/google/chrome/chrome | grep "not found"

# 测试浏览器
@vector4wang
vector4wang / readme.md
Last active July 26, 2019 02:42
[ffmpeg 常用命令] #ffmpeg
@vector4wang
vector4wang / note.md
Created July 22, 2019 06:34
[Idea 破解使用Jrebel] #Idea
  • 下载反向代理并启动,破解成功之前不可退出
  • 填写如下激活地址
http://127.0.0.1:8888/88414687-3b91-4286-89ba-2dc813b107ce
http://127.0.0.1:8888/ff47a3ac-c11e-4cb2-836b-9b2b26101696
http://127.0.0.1:8888/11d221d1-5cf0-4557-b023-4b4adfeeb36a
  • 切换到离线使用
@vector4wang
vector4wang / webconfig.java
Created July 21, 2019 14:50
[springboot 2.x 直接访问静态资源文件] #Springboot
@Component
public class WebMvcConfig implements WebMvcConfigurer {
/**
* 添加静态资源文件,外部可以直接访问地址
*
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
@vector4wang
vector4wang / note.md
Last active July 19, 2019 05:38
[Docker 安装Hbase开发环境] #Docker #Hbase

pull镜像

docker pull harisekhon/hbase

启动脚本

docker run -d -h base-server \
        -p 2181:2181 \
 -p 8080:8080 \
@vector4wang
vector4wang / note.md
Last active July 24, 2019 01:56
[Docker 安装 kafka] #Docker #Kafka #安装

download images

docker pull wurstmeister/zookeeper
docker pull wurstmeister/kafka
docker pull sheepkiller/kafka-manager
@vector4wang
vector4wang / demo.scala
Created July 8, 2019 12:03
[could not find implicit value for evidence parameter] #Scala
import org.apache.flink.streaming.api.scala._
解决could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[SomeType]
@vector4wang
vector4wang / pom.xml
Created July 8, 2019 11:22
[Idea 支持创建scala文件] #Maven #Scala
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>