Skip to content

Instantly share code, notes, and snippets.

View darenliang's full-sized avatar
💭
I may be slow to respond.

Daren Liang darenliang

💭
I may be slow to respond.
View GitHub Profile
@darenliang
darenliang / lz4_decoder.py
Created December 22, 2023 03:22
Simple LZ4 decoder in pure Python
import urllib.request
from typing import BinaryIO
import lz4.frame
class CountingReader:
"""
This wraps a read buffer and keeps track of the number of bytes read
"""

Keybase proof

I hereby claim:

  • I am darenliang on github.
  • I am darenliang (https://keybase.io/darenliang) on keybase.
  • I have a public key ASCH2hCqwEk6eTDOC6Ta4OZXh6_fQlelPijujG8D56T2GAo

To claim this, I am signing this object:

@darenliang
darenliang / locustfile.py
Created July 21, 2020 01:11
Basic Nikel API Benchmark Code
import random
import string
from locust import between, task
# Use fast http client
from locust.contrib.fasthttp import FastHttpUser
class NikelTestLoad(FastHttpUser):
# wait between 2 and 5 seconds
@darenliang
darenliang / linkedlist.go
Last active March 19, 2020 12:27
A simple linked list implementation in Go
package main
import "fmt"
// node struct
type node struct {
value interface{}
next *node
}