Skip to content

Instantly share code, notes, and snippets.

{"sig":"7d8ac8a76ccc873b8a3bdaa393f09ace12ef1fdf18b6ed02f0a4ee6d60ab387da406f5acaa11518b7230391f71e5bcac1bf74e7ecefc4aeaeb988b1f5301afad1","msghash":"d1c7fce48519dd7f6286eb3bf31bff553195951e7b1592c34f16a64997231b16"}
{"sig":"1356caa7a74534f6ec5332d24047784c7260af7fefc3981d56e4b3d87ec13c3dc9713311ff6b024cf0dcd9b6628492afe4b194d45c16a629fd98283f4478042c0","msghash":"3694a072c25a6dfd6ac58b22fc1a4be5c051a45cfb6496fc81b20154275f580a"}
@holys
holys / generate_json.go
Created August 17, 2016 02:56
generate_json
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"os"
)
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
@holys
holys / redis-benchmark.txt
Last active August 29, 2015 14:08
-P 区别真不是一般的大。 bulk rocks
% redis-benchmark -n 100000 -q -h 10.20.151.151 -P 128 holys@macmini
PING_INLINE: 1219512.12 requests per second
PING_BULK: 1204819.38 requests per second
SET: 507614.22 requests per second
GET: 892857.12 requests per second
INCR: 546448.06 requests per second
LPUSH: 581395.31 requests per second
LPOP: 606060.56 requests per second
SADD: 714285.69 requests per second
SPOP: 1086956.50 requests per second
@holys
holys / rp.go
Created October 27, 2014 11:24
package main
import (
"fmt"
)
func a(i int) int {
i = i + 1
if i <= 0 {
return a(i)
@holys
holys / c.go
Last active August 29, 2015 14:07
package main
import (
"crypto/rand"
"fmt"
)
type UUID [16]byte
func NewUUID() *UUID {
@holys
holys / b.go
Last active August 29, 2015 14:07
xiaomi oauth signature
package main
import (
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"fmt"
"io"
"net/url"
)
@holys
holys / a.go
Last active August 29, 2015 14:06
//refer: http://localhost:6060/blog/defer-panic-and-recover
package main
import (
"fmt"
)
//1. A deferred function's arguments are evaluated when the defer statement is evaluated.
func a() {
i := 0
package main
import (
"encoding/json"
"fmt"
)
type Vip struct {
ExpireTime int `json:"expire_time"`
MemberId int `json:"memberid"`