Skip to content

Instantly share code, notes, and snippets.

View panzhongxian's full-sized avatar

Zhongxian Pan panzhongxian

View GitHub Profile
panzhongxian / hyperloglog_dense_reg_histo_test.c
Created April 8, 2024 11:06
Test redis loop performance in hyperloglog.c
#include <stdint.h>
#define HLL_REGISTERS 16384
#define HLL_BITS 6
/* Compute the register histogram in the dense representation. */
void hllDenseRegHisto(uint8_t* registers, int* reghisto) {
int j;
/* Redis default is to use 16384 registers 6 bits each. The code works
* with other values by modifying the defines, but for our target value
panzhongxian /
Created January 10, 2024 08:59
Weixin official account auto reply server demo
from wx_mp_svr import Server, WxMpReqMsg, WxMpRspMsg # 从wx_mp_svr包中导入Server类
def main():
token = "xxx"
aes_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
appid = "YOUR_OWN_APP_ID"
host = ""
port = 5001
server = Server(
panzhongxian / compose.yml
Created September 2, 2023 10:35
Prometheus and Grafana demo env
image: "grafana/grafana"
- "3000:3000"
image: "prom/prometheus"
- "9090:9090"
panzhongxian /
Last active July 18, 2023 12:26
keep focus

This script will redirect the websites which may affect your concentration to /etc/hosts file.

panzhongxian /
Created October 14, 2019 12:18 — forked from myusuf3/
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule