Skip to content

Instantly share code, notes, and snippets.

address: 0.0.0.0
port: 8080
auth: false
tls: false
cert: cert.pem
key: key.pem
prefix: /dav
debug: false
# Default user settings (will be merged)
@urey-hiker
urey-hiker / rabbitmq_client.go
Last active November 27, 2021 13:33
rabbitmq client in golang.
package client
import (
"context"
"crypto/md5"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"net"
@urey-hiker
urey-hiker / .tmux.conf
Last active August 2, 2023 19:01
urey-hiker's tmux configuration
# remap prefix from 'C-b' to 'C-x'
#unbind C-b
#set-option -g prefix C-x
#bind-key C-x send-prefix
# split panes using | and -
bind | split-window -h
bind _ split-window -v
unbind '"'
unbind %
@urey-hiker
urey-hiker / minheap.lua
Last active May 12, 2018 08:35
minheap implemented by using lua table(array). Tested pass with luajit.
--[[ Copyright (C) urey-hiker (ureydev # aliyun.com)
usage:
local minheap = require("minheap")
local heap = minheap.new()
-- push an obj and ordered by ID in the heap
heap:push(ID, obj)
-- pop out the obj with the min ID
ID, obj = heap:pop()
-- peek the min obj and ID
@urey-hiker
urey-hiker / barrier.go
Last active March 1, 2018 10:04
Barrier for concurrency workers to do tasks synchronously.
package main
import "sync"
type barrier struct {
wc int
c chan int
wg sync.WaitGroup
sync.Mutex
}