Skip to content

Instantly share code, notes, and snippets.

View panzhongxian's full-sized avatar

Zhongxian Pan panzhongxian

View GitHub Profile
@panzhongxian
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
panzhongxian / demo.py
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 = "127.0.0.1"
port = 5001
server = Server(
@panzhongxian
panzhongxian / compose.yml
Created September 2, 2023 10:35
Prometheus and Grafana demo env
services:
grafana:
image: "grafana/grafana"
ports:
- "3000:3000"
promtheus:
image: "prom/prometheus"
ports:
- "9090:9090"
volumes:
@panzhongxian
panzhongxian / keep-focus.md
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
panzhongxian / delete_git_submodule.md
Created October 14, 2019 12:18 — forked from myusuf3/delete_git_submodule.md
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