This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/gob" | |
"reflect" | |
) | |
func RemoteOnline(id uint64) (uint64, string) { | |
return id, "abc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SNAPPY_DIR=/usr/local/snappy | |
LEVELDB_DIR=/usr/local/leveldb | |
ROOT_DIR=$(pwd) | |
BUILD_DIR=/tmp/build_leveldb | |
mkdir -p $BUILD_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package boltdb | |
import ( | |
"github.com/boltdb/bolt" | |
"github.com/boltdb/coalescer" | |
"github.com/siddontang/ledisdb/store/driver" | |
"os" | |
"path" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"github.com/hashicorp/raft" | |
"github.com/ugorji/go/codec" | |
"io" | |
"net" | |
"net/http" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <string> | |
#include "rocksdb/db.h" | |
#include "rocksdb/slice.h" | |
#include "rocksdb/options.h" | |
#include <unistd.h> | |
#include <sys/time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stop all docker containers | |
docker stop $(docker ps -a -q) | |
remove all docker containers | |
docker rm $(docker ps -a -q) | |
remove all <none> docker images | |
docker images --no-trunc | grep none | awk '{print $3}' | xargs docker rmi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// This program will read the Godeps.json and generate import list | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"sort" | |
"strings" | |
"github.com/PuerkitoBio/goquery" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "math" | |
// see http://www.gnu.org/software/libc/manual/html_node/Rounding.html | |
func rint(x float64) float64 { | |
v, frac := math.Modf(x) | |
if x > 0.0 { | |
if frac > 0.5 || (frac == 0.5 && uint64(v)%2 != 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"path" | |
"time" | |
"github.com/coreos/etcd/clientv3" |