This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.{Instant, ZoneId, ZonedDateTime} | |
import java.util.Properties | |
import org.apache.kafka.clients.consumer.KafkaConsumer | |
import org.apache.kafka.common.TopicPartition | |
import org.apache.kafka.common.serialization.StringDeserializer | |
import scala.collection.JavaConverters._ | |
object KafkaResetSample { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks.create<Jar>("fatJar") { | |
appendix = "fat" | |
setDuplicatesStrategy(DuplicatesStrategy.FAIL) | |
manifest { | |
attributes(mapOf("Main-Class" to "Main")) // replace it with your own | |
} | |
val sourceMain = java.sourceSets["main"] | |
from(sourceMain.output) | |
configurations.runtimeClasspath.filter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import getpass | |
import os | |
import pexpect | |
hosts = [''] | |
user = raw_input("type in the username:") | |
password = getpass.getpass('type in the password:') | |
expect_list = ['(yes/no)', 'password:'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[repositories] | |
local | |
maven-local | |
aliyun: http://maven.aliyun.com/nexus/content/groups/public | |
maven-central | |
sbt-maven-releases: https://repo.scala-sbt.org/scalasbt/maven-releases/, bootOnly | |
sbt-maven-snapshots: https://repo.scala-sbt.org/scalasbt/maven-snapshots/, bootOnly | |
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly | |
sbt-ivy-snapshots: https://repo.scala-sbt.org/scalasbt/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by renkai on 16/9/7. | |
*/ | |
object Main2 { | |
def isSingleton[A](a: A)(implicit ev: A <:< Singleton = null) = { | |
Option(ev).isDefined | |
} |
NewerOlder