Skip to content

Instantly share code, notes, and snippets.

View shijinkui's full-sized avatar

JK shijinkui

View GitHub Profile
package utils
import java.io.File
import com.google.common.base.Charsets
import com.google.common.io.Files
import scala.io.Source
/**
package utils
import scala.io.Source
/**
* parse jstack log
*/
object JavaStackParser {
def main(args: Array[String]): Unit = {
val lines = Source.fromFile("/Users/sjk/19229.log").getLines()
@shijinkui
shijinkui / gist:f254c9a9e1a5f6fa18c939a992912950
Created January 12, 2017 12:17
批量删除git branch和tag
git branch -r | awk -F/ '/\/release/{print $2}' | xargs -I {} git push origin :{}
git tag -l | xargs -n 1 git push --delete origin
server {
listen 7000;
server_name localhost;
location / {
root /Users/sjk/apps;
autoindex on;
}
@shijinkui
shijinkui / gist:7fa0d4529d58b3c2f160
Created July 25, 2015 08:41
scala promise 中netty channel 连接断开
val promise = Promise[ExecResult]()
// stop spark cluster
SparkUtil.stop(promise)
log.info("=========stopping spark cluster==========" + msg)
val f = promise.future
f onComplete {
case Success(x) =>
log.info("===================2222 " + x)
case Failure(x) =>
object Test {
def main(args: Array[String]): Unit = {
val j = new JSONObject(Map[String, Int]("11" -> 111, "ff" -> 234234))
println(j.toString())
val a = JSON.parseFull(j.toString())
a match {
case Some(x: Map[String, Any]) => println(x.getClass + "," + x)
case None =>
}
package akka
import akka.actor.{Actor, ActorSystem, Props}
import scala.concurrent.duration._
object AkkaScheduleTest {
def main(args: Array[String]) {
val system = ActorSystem("akka_system")
system.actorOf(Props[AkkaScheduleTest], "test_actor")