Skip to content

Instantly share code, notes, and snippets.

@lilac
lilac / issues.graphql
Last active April 15, 2019 02:24
List issues (with comments) of a repository
{
repository(name: "996.ICU", owner: "996icu") {
id
issues(first: 50) {
totalCount
nodes {
id
title
body
bodyText
@lilac
lilac / rpc.md
Last active April 16, 2019 08:32
RPC系统需求

一个好的远程调用服务(PRC)应该支持以下特性

  1. 服务发现
  2. 负载均衡(可配置策略)
  3. 限流(熔断)
  4. 鉴权
  5. 调用策略(重试,降级)
  6. 分布式追踪与性能监控
@lilac
lilac / json.scala
Created June 5, 2019 13:00
Json type in Dotty
case class Obj(val elems: (String, json)*) derives Eql
case class Arr(val elems: json*)
type json = Number | String | Obj | Arr
val s: json = Obj("a" -> 3, "b" -> "cd", "ar" -> Arr(1, "abc"))
println(s)
@lilac
lilac / sbt-repositories.ini
Last active September 15, 2019 11:21
墙内使用sbt的配置
[repositories]
#本地源
local
# repox-ivy: http://repox.gtan.com:8078/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
# repox-maven: http://repox.gtan.com:8078/
aliyun: http://maven.aliyun.com/nexus/content/groups/public/
#添加国外源备用
typesafe-ivy: https://dl.bintray.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
jboss-repository: http://repository.jboss.org/nexus/content/groups/public/
sbt: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
@lilac
lilac / Dockerfile
Created September 29, 2019 03:25
Run nginx on cloud run
FROM nginx
# COPY nginx.conf /etc/nginx/conf.d/default.conf
ADD run-nginx.sh .
CMD ["bash", "run-nginx.sh"]
@lilac
lilac / readme.md
Last active March 15, 2020 07:29
Kiss

Introduction

Kiss (keep it simple server), is a simple micro service toolkit, with batteries included to ship it to production with no effort.

Goals

  • Simple

    Simple to understand, and easy to start.

  • Production ready

@lilac
lilac / ReadMe.md
Created November 30, 2021 15:25
Implement method overriding of OOP in SML

It follows the interface (trait) oriented programming style.

@lilac
lilac / a-guide.md
Last active December 4, 2022 09:13
Embed javascript in JVM

Prerequisites

  1. Install graalvm.
sdk install java 22.3.r19-grl
  1. Change current JVM to graalvm.
sdk use java 22.3.r19-grl
  1. Install Graal js following the guide.
@lilac
lilac / fstore.md
Last active October 20, 2023 03:45
A database tailored for feature store

Build a persistent, high availability and low latency key-value storage engine for derived data. One of such use cases is feature store. These use cases share some common characteristics, that we could utililze to build a better performing database.

  1. The data is derived, so no need to handle replication or data recovery.
  2. All the writes are through bulk loading, so no concurrency control needed.

In summary, it's like a scalable cache engine.

Features

  • High throughput bulk load