Skip to content

Instantly share code, notes, and snippets.

View RebieKong's full-sized avatar
🎯
Focusing

RebieKong RebieKong

🎯
Focusing
View GitHub Profile
@RebieKong
RebieKong / maven-build-scala.xml
Last active January 10, 2019 17:31
在maven中构建scala
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.4</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
@RebieKong
RebieKong / get_cp.sh
Created October 10, 2017 05:47
扫描文件夹中指定后缀名并连接起来
#!/usr/bin/env bash
export CLASSPATH_DIR="$(cd `dirname $0`/../lib; pwd)"
export CLASS_PATH=`find ${CLASSPATH_DIR} -name '*.jar' | xargs | sed "s/ /${CP_SPLIT}/g"`
@RebieKong
RebieKong / maven-lib.xml
Last active March 21, 2018 07:40
maven打包时依赖包的处理方法
<!-- 打包时将依赖放到target/lib目录下 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
@RebieKong
RebieKong / deploy-to-oss.xml
Created November 1, 2017 03:29
在maven中添加自己的maven库和部署到ossfs指定的目录
<distributionManagement>
<repository>
<id>mvn-repo</id>
<url>file:/mnt/data/oss-mvn/data</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>rebie-maven</id>
<url>https://mvn.rebiekong.com/</url>
@RebieKong
RebieKong / maven-java-version.xml
Created November 7, 2017 03:21
声明java编译的版本
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
@RebieKong
RebieKong / maven.build.xml
Created November 7, 2017 03:23
常用的一个maven-build的节点
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
<filtering>false</filtering>
</resource>
@RebieKong
RebieKong / anwser.scala
Created March 21, 2018 02:44
相同QQ群问题
val input: Seq[(String, Seq[String])] = List[(String, List[String])](
("A", List[String]("1", "2", "3")),
("B", List[String]("2", "3")),
("C", List[String]("3", "4"))
)
val output = input
// 转化成 uid => gid
.flatten(i => i._2.map(uid => (uid, i._1)))
// 转化成 uid => set(gid)
.groupBy(i => i._1)
@RebieKong
RebieKong / Test.java
Created March 29, 2018 07:26
IPIP.net的DATX遍历进行中
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
public class Test {
private final static Integer INDEX_START = 262148;
@RebieKong
RebieKong / shadowsocks.conf
Created April 18, 2018 13:47
supervisor-conf-file
[program:shadowsocks]
directory = /
command = sslocal -s 1.1.1.1 -p 65536 -k password -m rc4-md5 -l 65536
autostart = true
startsecs = 15
autorestart = true
startretries = 3
user = nobody
redirect_stderr = true
stdout_logfile_maxbytes = 20MB
import org.apache.carbondata.format.BlockIndex;
import org.apache.carbondata.format.FileFooter3;
import org.apache.carbondata.format.IndexHeader;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.transport.TIOStreamTransport;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;