Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

RebieKong RebieKong

🎯
Focusing
Block or report user

Report or block RebieKong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RebieKong
RebieKong / get_cp.sh
Created Oct 10, 2017
扫描文件夹中指定后缀名并连接起来
View get_cp.sh
#!/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 / deploy-to-oss.xml
Created Nov 1, 2017
在maven中添加自己的maven库和部署到ossfs指定的目录
View deploy-to-oss.xml
<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 Nov 7, 2017
声明java编译的版本
View maven-java-version.xml
<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 Nov 7, 2017
常用的一个maven-build的节点
View maven.build.xml
<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 Mar 21, 2018
相同QQ群问题
View anwser.scala
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 / maven-lib.xml
Last active Mar 21, 2018
maven打包时依赖包的处理方法
View maven-lib.xml
<!-- 打包时将依赖放到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 / Test.java
Created Mar 29, 2018
IPIP.net的DATX遍历进行中
View Test.java
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 Apr 18, 2018
supervisor-conf-file
View shadowsocks.conf
[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
View read-carbon-with-thrift
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;
@RebieKong
RebieKong / maven-build-scala.xml
Last active Jan 10, 2019
在maven中构建scala
View maven-build-scala.xml
<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>
You can’t perform that action at this time.