Skip to content

Instantly share code, notes, and snippets.

View tisonkun's full-sized avatar
🏠
Working from home

tison tisonkun

🏠
Working from home
View GitHub Profile
@tisonkun
tisonkun / Cargo.lock
Last active January 15, 2025 22:47
Open-source dependencies for ScopeDB 0.1.19
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "addr2line"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
dependencies = [
@tisonkun
tisonkun / monthly_contributor.py
Last active October 4, 2024 12:42
Calculate Monthly Git Contributors
# pip3 install GitPython
# pip3 install pandas
# pip3 install matplotlib
from git import Repo
repo = Repo('.')
list_of_commits = [(commit.committed_datetime, commit.author.email) for commit in repo.iter_commits()]
import pandas
df = pandas.DataFrame(list_of_commits, columns =['datetime', 'author'])
@tisonkun
tisonkun / impls.rs
Created September 26, 2024 02:39
Reuse containers in test
use std::collections::HashMap;
use std::str::FromStr;
use std::time::Duration;
use bollard::container::Config;
use bollard::container::CreateContainerOptions;
use bollard::container::LogOutput;
use bollard::container::LogsOptions;
use bollard::image::CreateImageOptions;
use bollard::models::ContainerStateStatusEnum;
bun test
bun test v1.0.2 (37edd5a6)
test/updateWith.spec.js:
✓ updateWith > should work with a `customizer` callback [2.01ms]
✓ updateWith > should work with a `customizer` that returns `undefined` [0.09ms]
test/isArrayBuffer.spec.js:
✓ isArrayBuffer > should return `true` for array buffers [0.04ms]
✓ isArrayBuffer > should return `false` for non array buffers [0.10ms]
@tisonkun
tisonkun / tokenizer.rs
Last active July 3, 2023 04:56
PostgreSQL tokenizer
// Copyright 2023 Korandoru Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@tisonkun
tisonkun / BoolExpResolver.java
Created October 8, 2022 11:22
Boolean Expression Resolver
package io.korandoru.boolexp.resolver;
import io.korandoru.boolexp.resolver.parser.BoolExpBaseVisitor;
import io.korandoru.boolexp.resolver.parser.BoolExpLexer;
import io.korandoru.boolexp.resolver.parser.BoolExpParser;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@tisonkun
tisonkun / pulsar-server-logs.log
Created July 3, 2022 06:28
Pulsar SQL example cannot reproduce in master (2.11.0-SNAPSHOT) Logs
2022-07-03T14:22:20,939+0800 [main] INFO org.apache.pulsar.PulsarStandalone - Starting BK with RocksDb metadata store
2022-07-03T14:22:22,625+0800 [main] INFO org.apache.pulsar.metadata.impl.RocksdbMetadataStore - new RocksdbMetadataStore,url=MetadataStoreConfig(sessionTimeoutMillis=30000, allowReadOnlyOperations=false, configFilePath=null, batchingEnabled=true, batchingMaxDelayMillis=5, batchingMaxOperations=1000, batchingMaxSizeKb=128),instanceId=2
2022-07-03T14:22:22,635+0800 [main] INFO org.apache.pulsar.metadata.bookkeeper.PulsarRegistrationManager - Initializing metadata for new cluster, ledger root path: /ledgers
2022-07-03T14:22:22,643+0800 [main] ERROR org.apache.pulsar.metadata.bookkeeper.PulsarRegistrationManager - Ledger root path: /ledgers already exists
2022-07-03T14:22:22,656+0800 [main] INFO org.apache.pulsar.metadata.bookkeeper.BKCluster - Starting new bookie on port: 3181
2022-07-03T14:22:22,668+0800 [main] INFO org.apache.bookkeeper.server.Main - Load lifecycle component : org.apache.b
[Goroutine 13 in state select, with go.opencensus.io/stats/view.(*worker).start on top of the stack:
goroutine 13 [select]:
go.opencensus.io/stats/view.(*worker).start(0xc0003a8280)
/Users/tison/go/pkg/mod/go.opencensus.io@v0.22.3/stats/view/worker.go:154 +0xcd
created by go.opencensus.io/stats/view.init.0
/Users/tison/go/pkg/mod/go.opencensus.io@v0.22.3/stats/view/worker.go:32 +0x57
Goroutine 62 in state chan receive, with go.etcd.io/etcd/pkg/logutil.(*MergeLogger).outputLoop on top of the stack:
goroutine 62 [chan receive]:
go.etcd.io/etcd/pkg/logutil.(*MergeLogger).outputLoop(0xc00011fda0)
@tisonkun
tisonkun / systime_mon.go
Created August 3, 2021 02:20
System time monitor
package systimemon
import (
"time"
)
// StartMonitor will call systimeErrHandler if system time jump backward.
func StartMonitor(now func() time.Time, systimeErrHandler func()) {
tick := time.NewTicker(100 * time.Millisecond)
defer tick.Stop()
@tisonkun
tisonkun / meta.md
Last active March 30, 2021 00:40
Competitive Product Analysis - Federated Query

Competitive Products

  • Presto
  • Snowflake