Instantly share code, notes, and snippets.

View adding-version.go
package main
import (
"flag"
"os"
"strings"
)
var (
Version = "1.0.0"
View mongodb-multi-collection-query-by-go.go
// import (
// "fmt"
// "time"
//
// mgo "gopkg.in/mgo.v2"
// "gopkg.in/mgo.v2/bson"
// )
// ``` cmd in mongo shell
// db.Slot.aggregate([
View redis-sub-pub-golang-demo.go
package main
import (
"encoding/json"
"fmt"
"log"
"time"
"gopkg.in/redis.v2"
)
View dockerctl.sh
#!/usr/bin/env bash
cids=`docker ps -a | awk 'FNR>1 {print $1}'`
function stop() {
for v in $cids
do
echo "stop "$v
docker stop $v
done