Skip to content

Instantly share code, notes, and snippets.

View Kiollpt's full-sized avatar

Kiollpt

View GitHub Profile
@Kiollpt
Kiollpt / Outline.md
Created September 8, 2020 14:05
#DDI

ch1

thinking about the data system

@Kiollpt
Kiollpt / main.py
Last active September 12, 2020 05:20
main
if __name__ == "__main__":
@Kiollpt
Kiollpt / csv to kafka.scala
Last active November 5, 2020 09:57
#spark
def main(args: Array[String]): Unit = {
val ss = SparkSession.builder().master("local[*]").appName("app1").getOrCreate()
import ss.implicits._
val filePath = "src/resource"
val schema = Encoders.product[order].schema
val ds = ss.readStream.option("header","true").schema(schema).csv(filePath)
val ds1 = ds.select( lit("1") as "key",to_json(struct("*"))as "value")
@Kiollpt
Kiollpt / array.md
Last active October 26, 2020 09:11
#Leetcode

Array

  • * 27 Remove Element 视频讲解
  • * 26 Remove Duplicates from Sorted Array 视频讲解 L1:match condition | L2
  • ? 80 Remove Duplicates from Sorted Array II 视频讲解
  • 277 Find the Celebrity 视频讲解
  • * 189 Rotate Array 视频讲解
  • * 41 First Missing Positive 视频讲解
  • *? 299 Bulls and Cows 视频讲解
  • 134 Gas Station 视频讲解
@Kiollpt
Kiollpt / Stateful.scala
Last active November 20, 2020 10:14
#Spark
val output = ds.groupByKey(_.`pickup zone`).mapGroupsWithState[State,Result](GroupStateTimeout.NoTimeout()){
case (key:String,values:Iterator[order],state: GroupState[State]) => {
val data = values.toSeq
println(data)
val size = data.size
print()
val updateState = if(state.exists) {
@Kiollpt
Kiollpt / Event-stream based GraphQL subscriptions.md
Created December 13, 2020 03:32 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@Kiollpt
Kiollpt / start
Last active January 25, 2021 13:24
#tmux
setpup:
~/.vimrc
set mouse=a
watch tail logfile1 logfile2
shortcut : tmux a -t #num
@Kiollpt
Kiollpt / bash
Last active July 19, 2021 08:26
#Linux
LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS; ls
export LS_OPTIONS='--color=auto'
#eval "$(dircolors -b)"
alias ls='ls $LS_OPTIONS'
# tmux
‎‎​
@Kiollpt
Kiollpt / aa
Created July 13, 2021 05:49
airflow test
ss