Skip to content

Instantly share code, notes, and snippets.

@nmarley
nmarley / README.md
Last active March 31, 2025 22:32
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
@baymaxium
baymaxium / content.md
Created October 18, 2017 09:20
基于Falcon的滴滴内部监控系统

原文:高可用架构

导读:监控是架构可用性中最关键的环节之一,高可用架构邀请了滴滴的研发工程师聂安,分享了滴滴监控系统 DD-Falcon 近期的一些进展。

作者简介

聂安,滴滴运维研发工程师,长期从事监控、部署等运维工具平台的开发。现就职于滴滴,曾就职于阿里、小米。

很高兴和大家一起分享滴滴监控系统 DD-Falcon 近期的一些进展。今天分享主要包括如下几个部分 (技术架构、产品形态):

@asm-jaime
asm-jaime / go-gin-mgo.go
Last active February 20, 2021 21:13
go gin mgo, gin+mongo+test example
package main
import (
"encoding/base64"
"fmt"
rand "math/rand"
"time"
"github.com/gin-gonic/gin"
package main
import (
"bytes"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"sync"
@travisjeffery
travisjeffery / functional-options.md
Last active April 23, 2023 11:13
How to do functional options in Golang

Here's the simplest example showing how to do functional options in Golang.

They're a great way to enable users to set options and ease adding new options later.

package main

import (
	"flag"
	"fmt"
@yaud
yaud / flushall-cluster.sh
Created November 14, 2016 09:21
Flushall on Redis cluster
#!/bin/sh
NODES=`redis-cli -h $1 cluster nodes | cut -f2 -d' '`
IFS="
"
for node in $NODES; do
echo Flushing node $node...
redis-cli -h ${node%:*} -p ${node##*:} flushall
@x32net
x32net / wait_timeout.go
Created June 8, 2016 07:32
Golang - WaitGroup Timeout
package main
import (
"fmt"
"sync"
"time"
)
func main() {
wg := sync.WaitGroup{}
@laeshiny
laeshiny / mgoTestExample.go
Last active February 18, 2022 09:23
mgo test example
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Content struct {
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active September 9, 2025 01:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: