This file contains 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 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 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 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 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 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 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
const int align = 8; | |
size_t round_up(size_t bytes) | |
{ | |
return ((bytes) + align - 1) & ~(align - 1) | |
} |
This file contains 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 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
worker_processes 1; | |
events { | |
use epoll; | |
} | |
http { | |
default_type text/html; | |
server { | |
listen 80; | |
server_name localhost; | |
This file contains 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 "rsa.h" | |
#include <stdio.h> | |
#include <conio.h> | |
#include <windows.h> | |
#include <wincrypt.h> | |
#include "base64.h" | |
#pragma comment(lib, "crypt32.lib") |
OlderNewer