Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey Shcherbakov fuCtor

View GitHub Profile
View gist:8cafcefe58dfee31d3a62eacd1f2423c
dockerCommands := Source.fromFile(file).mkString
.replace("\\\n", "").split("\n")
.withFilter(_.nonEmpty).map((line) => {
val cmd :: args = line.stripLineEnd.split(" ").toList
Cmd(cmd, args.mkString(" "))
}).toSeq
View FileReader.scala
import java.io._
import monix.reactive.Observable
object FileReader {
def fileObservable(files: Seq[String]): Observable[String] = {
Observable.fromIterable(files).flatMap({ file =>
Observable.fromLinesReader(new BufferedReader(new InputStreamReader(new FileInputStream(file))))
.doOnSubscribe(() => println(s"START [$file]"))
.doOnComplete(() => println(s"FINISH [$file]"))
})
View lda.py
file_names = os.listdir(PATH)
texts = []
for name in file_names:
if name.endswith(".txt"):
with codecs.open(PATH + "/" + name, encoding = 'utf-8') as f:
print(name)
text = f.read()
lst = re.findall(r'\w+', text)
words = []
for word in lst:
View gist:e60e16d291645d8b9da403ea0f4d5689
<yandex>
<interserver_http_port>9009</interserver_http_port>
<remote_servers>
<test_dmp_rt>
<shard>
<replica>
<host>clickhouse-server_1</host>
<port>9009</port>
</replica>
<replica>
View response.txt
select version()
SELECT version()
┌─version()─┐
│ 19.15.3.6 │
└───────────┘
1 rows in set. Elapsed: 0.008 sec.