Skip to content

Instantly share code, notes, and snippets.

View jmrenouard's full-sized avatar
😎
Under control for this moment

Jean-Marie Renouard jmrenouard

😎
Under control for this moment
View GitHub Profile
@knqyf263
knqyf263 / redis_test.go
Last active May 16, 2023 14:11
go-redis pipeline
func TestRedis(t *testing.T) {
s, _ := testutil.PrepareTestRedis()
for i := 0; i < 10000; i++ {
s.Set("key"+strconv.Itoa(i), "hoge"+strconv.Itoa(i))
}
client := redis.NewClient(&redis.Options{Addr: s.Addr()})
// 普通にループ
result := map[string]string{}
for i := 0; i < 10000; i++ {
@simov
simov / html-toc.js
Created January 22, 2017 10:57
Generate Table of Contents (TOC) from rendered HTML document's header tags
// extract all headers
var headers = []
function walk (nodes) {
nodes.forEach((node) => {
var sub = Array.from(node.childNodes)
if (sub.length) {
walk(sub)
@zacharyvoase
zacharyvoase / gist:1770447
Created February 8, 2012 15:28
zmqc: A small but powerful command-line interface to ZMQ.
#!/usr/bin/env python
# zmqc: a small but powerful command-line interface to ZMQ.
## Usage:
# zmqc [-0] (-r | -w) (-b | -c) SOCK_TYPE [-o SOCK_OPT=VALUE...] address [address ...]
## Examples:
# zmqc -rc SUB 'tcp://127.0.0.1:5000'
#
# Subscribe to 'tcp://127.0.0.1:5000', reading messages from it and printing