Skip to content

Instantly share code, notes, and snippets.

View defp's full-sized avatar

lidashuang defp

View GitHub Profile
# getQuantumultNodes
# https://github.com/geekdada/surgio/blob/cef5c3f2cc672b562942b12cb210418f97ce1225/lib/utils/index.ts#L812
str = File.read!("./dist/quan_subscribe.conf")
# str内容示例 surgio生成
# {{ getQuantumultNodes(nodeList, provider) | base64 }}
# dm1lc3M6Ly84SitIcmZDZmg3QklTeUJoY0hBdVpuTnpMbkoxYmlCMmJXVnpjeUE5SUhadFpYTnpMR0Z3Y0M1bVlYTXVjblZ1TERFd01EQXNibTl1WlN3aU1UVmhObVl5TVRVNE55MDBNV1ZtTFdJME5UZ3RNbVJsWXpRNE5EazFaRGd4SWl3eU16TXNaM0p2ZFhBOVlXeHBlWFZ1WDNadFpYTnpMRzkyWlhJdGRHeHpQV1poYkhObExHTmxjblJwWm1sallYUmxQVEVzYjJKbWN6MTBZM0FzYjJKbWN5MXdZWFJvUFNJdklpeHZZbVp6TFdobFlXUmxjajBpYUc5emREcGhjSEF1Wm1GekxuSjFibHRTY2wxYlRtNWRkWE5sY2kxaFoyVnVkRHBOYjNwcGJHeGhMelV1TUNBb2FWQm9iMjVsT3lCRFVGVWdhVkJvYjI1bElFOVRJREV5WHpOZk1TQnNhV3RsSUUxaFl5QlBVeUJZS1NCQmNIQnNaVmRsWWt0cGRDODJNRFV1TVM0eE5TQW9TMGhVVFV3c0lHeHBhMlVnUjJWamEyOHBJRTF2WW1sc1pTOHhOVVV4TkRnaQpodHRwOi8vOEorSHNQQ2ZoN2ZwbjZubG03MGdTMVFnZURBdU5DQTlJR2gwZEhBc0lIVndjM1J5WldGdExYQnliM2g1TFdGa1pISmxjM005ZEdWemRDNWhjSEF1WTI5dExDQjFjSE4wY21WaGJTMXdjbTk0ZVMxd2IzSjBQVEV4TV
@defp
defp / sleep.go
Created August 24, 2018 16:30
RoundTripper demo
package main
import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"net/http"
"strings"
"time"
@defp
defp / Makefile
Created September 12, 2017 09:10 — forked from isaacs/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.
@defp
defp / singleton_methods.rb
Created August 16, 2017 09:59
定义单例方法的方式
# 定义单例方法的方式
# 1
class A
def self.hi
p 'hi'
end
end
# 2
local a = {
field1 = 1
}
local b = {
field2 = 2
}
-- 声明表a b
-- 设置 a 的元表是 b
@defp
defp / douban.rb
Last active August 1, 2017 10:14
douban 相册下载
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)

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:

[: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,"
@defp
defp / cc.log
Created June 8, 2017 09:06
login request
[: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
[: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","