Skip to content

Instantly share code, notes, and snippets.

View ZenLiuCN's full-sized avatar
🎯
Focusing

Zen Liu ZenLiuCN

🎯
Focusing
  • China Sichuan
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package main
import (
"net/http"
"os"
"path/filepath"
"log"
)
func main() {
@ZenLiuCN
ZenLiuCN / ANLTR4.md
Created April 16, 2020 15:36
ANLTR4

ANTLR

ANTLR是什么

ANTLR (ANother Tool for Language Recognition)是一项开源的java编写的语法/词法分析器套件.

通过ANTLR可以生成语法处理器来对进行文本或二进制文件进行解析处理.

ANTLR由定义语法,编译工具和运行时库组成.

Just other common useable DDD like design pattern

layers

This will describe from inner to outter , from lower to higher

layers of application

  1. Infrastructure should not depend on other layer except implement some port in core
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
rm -rf .idea/ && find . -name "*.iml" -type f -delete
package tester;
import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.Schema;
import io.protostuff.runtime.DefaultIdStrategy;
import io.protostuff.runtime.IdStrategy;
import io.protostuff.runtime.RuntimeSchema;
import lombok.SneakyThrows;
import lombok.ToString;

Common Maven Config properties

File Encode

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Java Versions

<java.version>1.8</java.version>

1.8

@ZenLiuCN
ZenLiuCN / docker_cheat.md
Last active July 19, 2021 05:40
DOCKER_CHEAT

Docker Cheat Tips

1. run deno inside docker

run deno inside docker

script or command to start :

#!/bin/sh
docker run --rm \
-a STDIN -a STDOUT -a STDERR \
public interface ClassSerialize{
static String classToString(Class cls) {
return cls.getName()
.replaceFirst("class ", "")
.replaceFirst("interface ", "");
}
@SneakyThrows
static Class stringToClass(String cls) {
if (cls.contains("$")) {