Skip to content

Instantly share code, notes, and snippets.

@kaichen
kaichen / get_actions.json
Created December 26, 2018 07:51
eos history api
{
"actions": [
{
"_id": "5c232c16b5035bc1a6dc7585",
"receipt": {
"receiver": "luckymearena",
"act_digest": "f7b0b39cac563a1ab054a192ef017a7d45e34e07a12b49e0ed29bd117f3448ba",
"global_sequence": 3310712726,
"recv_sequence": 2827,
"auth_sequence": [
@kaichen
kaichen / luxe-ens-management.md
Last active November 6, 2018 06:25
how to integrate with luxe IANA

luxe ens managment

data structure:

mapping(uint=>mapping(address=>bool)) public registrars; // Maps IANA IDs to authorised accounts
mapping(bytes32=>uint) public nonces; // Maps namehashes to domain nonces

keep track mapping of user id and ethereum address, and domain nonce

@kaichen
kaichen / eth-2.md
Created October 12, 2018 09:42
Curated List about Eth 2.0

Keybase proof

I hereby claim:

  • I am kaichen on github.
  • I am kaichen (https://keybase.io/kaichen) on keybase.
  • I have a public key ASBjEVXtZDGDQCOWtGTKW_2c8wx41gXbDsXB1ghErZOYGQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am kaichen on github.
  • I am kaichen (https://keybase.io/kaichen) on keybase.
  • I have a public key ASBjEVXtZDGDQCOWtGTKW_2c8wx41gXbDsXB1ghErZOYGQo

To claim this, I am signing this object:

@kaichen
kaichen / allocate.json
Created February 22, 2016 02:09
雪球抓包结果
/* GET /allocate.json HTTP/1.1 */
{
"api": ["124.250.3.102", "124.250.3.103", "101.201.175.228", "182.92.251.113"],
"expires": 300,
"fund": ["124.250.3.84", "124.250.3.85"],
"https": true,
"im": ["124.250.3.78:8080", "124.250.3.78:80", "124.250.3.78:8400", "124.250.3.79:8080", "124.250.3.78:443", "124.250.3.79:443", "124.250.3.78:8443", "124.250.3.79:8400", "124.250.3.79:8443", "124.250.3.79:80"],
"pingan": ["124.250.3.102", "124.250.3.101"],
"promo": ["124.250.3.102", "124.250.3.103"],
"stock": ["182.92.251.113", "101.201.175.228", "124.250.3.102", "124.250.3.103"],
@kaichen
kaichen / multi_thread_scheduler.rb
Created January 4, 2016 12:49
简单多线程调度
require "thread"
require "set"
Thread.abort_on_exception = true
# 调度器
class Manager
def initialize
@job_queue = JobQueue.new
@workers = Set.new
@kaichen
kaichen / gist:fae0c1bc836ee3cbec72
Created August 25, 2014 09:48
Rubygems Loading and Memory
Rubygems:rails mem=0KB
Rubygems:i18n mem=0KB
Rubygems:activesupport-json_encoder mem=0KB
Rubygems:actionpack-action_caching mem=0KB
Rubygems:actionpack-page_caching mem=0KB
Rubygems:rails-observers mem=0KB
Rubygems:pg mem=1488KB
Rubygems:unicorn mem=0KB
Rubygems:unicorn-worker-killer mem=0KB
Rubygems:polyamorous mem=32KB
@kaichen
kaichen / gist:11280740
Last active August 29, 2015 14:00
你好MySQL,再见MySQL
SELECT 'normal' = 0 #=> 1
SELECT 'disable' = 0 #=> 1
SELECT 'disable1' = 0 #=> 1
SELECT '1disable' = 0 #=> 0
SELECT '123456' = 0 #=> 0