Skip to content

Instantly share code, notes, and snippets.

View Renz7's full-sized avatar
🎯
Focusing

renz7 Renz7

🎯
Focusing
  • Wuhan,China
View GitHub Profile
@Renz7
Renz7 / trie.go
Created May 3, 2023 23:26
a tire tree in go
package internal
type Tire struct {
root *trieNode
}
type trieNode struct {
value string
end bool
children map[interface{}]*trieNode
@Renz7
Renz7 / mutex_test.go
Created April 12, 2023 13:33
golang mutex
package sync
import (
"encoding/json"
"fmt"
"sync"
"testing"
"time"
)
@Renz7
Renz7 / atmic_test.go
Created April 12, 2023 13:32
golang sync_atomic
package sync
import (
"sync"
"sync/atomic"
"testing"
)
func TestAtomic(t *testing.T) {
count := atomic.Int32{}
@Renz7
Renz7 / exit_chanal_test.go
Created April 12, 2023 13:27
golang channel 泄露
package sync
import (
"runtime"
"testing"
"time"
)
func readCh(ch chan interface{}) {
for {
@Renz7
Renz7 / Dockerfile
Created November 23, 2022 09:10
install vcredist_x64 in windows dockr container
RUN powershell.exe -Command Start-Process "c:/vcredist_x64.exe /passive" -Wait
@Renz7
Renz7 / rpcserver.py
Created August 18, 2022 09:15 — forked from sporsh/rpcserver.py
A Twisted example to demo deferreds, client/server protocols and endpoints
import time
from twisted.python import failure
from twisted.internet import reactor, defer, task
from twisted.internet.protocol import Protocol
# Define some messages for our protocol
MSG_REQUEST = '>'
MSG_REQ_ACK = ':'
MSG_REQ_SUCCEEDED = '='
@Renz7
Renz7 / log.go
Last active July 9, 2021 21:24
A golang logger example
package logging
import (
"log"
"os"
"sync"
)
type LogWriter struct {
Stdout bool
@Renz7
Renz7 / 🎵 My last week in music
Last active June 18, 2023 01:14
my nestease music rank
🥇 有没有人告诉你 - 陈楚生 · 1 plays
🥈 只要平凡 - 张杰/张碧晨 · 1 plays
🥉 そばにいるね - 青山テルマ · 1 plays
ありがとう··· - KOKIA · 1 plays
二缺一 - 蔡卓妍 · 1 plays
Java 2 hrs 14 mins ██████░░░░░░░░░░░░░░░ 29.1%
Go 1 hr 50 mins █████░░░░░░░░░░░░░░░░ 24.0%
Python 1 hr 7 mins ███░░░░░░░░░░░░░░░░░░ 14.6%
Vue.js 58 mins ██▋░░░░░░░░░░░░░░░░░░ 12.7%
HTTP Re... 28 mins █▎░░░░░░░░░░░░░░░░░░░ 6.1%