Skip to content

Instantly share code, notes, and snippets.

lidashuang lidashuang

Block or report user

Report or block lidashuang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lidashuang
lidashuang / sleep.go
Created Aug 24, 2018
RoundTripper demo
View sleep.go
package main
import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"net/http"
"strings"
"time"
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@lidashuang
lidashuang / singleton_methods.rb
Created Aug 16, 2017
定义单例方法的方式
View singleton_methods.rb
# 定义单例方法的方式
# 1
class A
def self.hi
p 'hi'
end
end
# 2
View __index.lua
local a = {
field1 = 1
}
local b = {
field2 = 2
}
-- 声明表a b
-- 设置 a 的元表是 b
@lidashuang
lidashuang / douban.rb
Last active Aug 1, 2017
douban 相册下载
View douban.rb
require 'net/http'
require 'net/https'
require 'json'
# Request (12) (GET )
def send_request(id)
uri = URI("https://api.douban.com/v2/album/#{id}/photos?count=100")
puts uri
# Create client
http = Net::HTTP.new(uri.host, uri.port)
View keybase.md

Keybase proof

I hereby claim:

  • I am lidashuang on github.
  • I am lidashuang (https://keybase.io/lidashuang) on keybase.
  • I have a public key whose fingerprint is 764F 2206 B7E4 CA69 0CED E3CA 6941 A803 8A13 8840

To claim this, I am signing this object:

View start.log
[:000000b7] {"level":6,"msg":"client connect","name":"gated","time":"2017-06-15T10:38:05+0800"}
[:0000000e] {"level":7,"msg":"allocate 157 by creating new connection","name":"sx_redis_pool","time":"2017-06-15T10:38:05+0800"}
[:0000000e] {"level":7,"msg":"HGET block 639686","name":"sx_redis_pool","time":"2017-06-15T10:38:05+0800"}
[:000000b7] {"module":"gated_auth","profile_id":"409198178614","request_duration":0,"user_id":"639686","name":"gated","request_status":"OK","user_provider":"dev","level":6,"time":"2017-06-15T10:38:05+0800"}
[:0000000e] {"level":7,"msg":"cache 157","name":"sx_redis_pool","time":"2017-06-15T10:38:05+0800"}
[:000000c1] {"name":"agent","level":6,"time":"2017-06-15T10:38:05+0800","msg":"Agent resumed 169","profile_id":"409198178614","user_id":"639686"}
[:000000c1] {"module":"heartbeat","profile_id":"409198178614","request_duration":0,"user_id":"639686","name":"agent","request_status":"OK","time":"2017-06-15T10:38:05+0800","level":6,"args":"nil","msg":"request OK"}
[:0000000e] {"level":7,"
View cc.log
[:000000b7] {"level":6,"msg":"client connect","name":"gated","time":"2017-06-08T17:06:52+0800"}
[:0000000e] {"level":7,"msg":"allocate 156 by creating new connection","name":"sx_redis_pool","time":"2017-06-08T17:06:52+0800"}
[:0000000e] {"level":7,"msg":"HGET block 640553","name":"sx_redis_pool","time":"2017-06-08T17:06:52+0800"}
[:000000b7] {"module":"gated_auth","profile_id":"410308145830","request_duration":0.01,"user_id":"640553","name":"gated","request_status":"OK","user_provider":"dev","level":6,"time":"2017-06-08T17:06:52+0800"}
[:0000000e] {"level":7,"msg":"cache 156","name":"sx_redis_pool","time":"2017-06-08T17:06:52+0800"}
[:000000c1] LAUNCH snlua agent
[:0000000e] {"level":7,"msg":"allocate 156 from pool","name":"sx_redis_pool","time":"2017-06-08T17:06:52+0800"}
[:000000c1] {"name":"agent","level":6,"time":"2017-06-08T17:06:52+0800","msg":"Agent started 166","profile_id":"410308145830","user_id":"640553"}
[:0000000e] {"level":7,"msg":"LRANGE rq:410308145830:current 0 -1","name":"sx_redis_pool","ti
View fight.log
[:0000000e] {"level":7,"msg":"HGET Profile:410308145830 Timestamps","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:410308145830:inbox rq:410308145830:cu","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"HGET Profile:410308145830 Daily","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"ZCARD pvp:rank","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 64","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 30","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 65","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 71","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"}
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 1","
View rediscall.txt
[:0000000e] {"level":7,"msg":"allocate 156 by creating new connection","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"HGET block 628426","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"cache 156","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"allocate 156 from pool","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"LRANGE rq:394919237477:current 0 -1","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:394919237477:inbox rq:394919237477:cu","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:394919237477:inbox rq:394919237477:cu","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:394919237477:inbox rq:394919237477:cu","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"}
[:0000000e] {"level":7,"msg":"HG
You can’t perform that action at this time.