Skip to content

Instantly share code, notes, and snippets.

@Jxck
Jxck / README.md
Created December 16, 2012 09:16
libuv TCP server/client sample

how to compile

$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices server.c -o server
$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices client.c -o client
func padding(str string) string {
return strings.Repeat("0", 8 - len(str)) + str
}
@Jxck
Jxck / .gitignore
Created January 24, 2013 16:32
Socket.IO sample for Node.js_jp ML
node_modules
@Jxck
Jxck / main.go
Last active August 31, 2017 10:27
interface of Go blog sample
package main
/*
Go のインタフェース設計
参考
https://code.google.com/p/go-wiki/wiki/GoForCPPProgrammers
http://jordanorelli.tumblr.com/post/32665860244/how-to-use-interfaces-in-go
http://research.swtch.com/interfaces
http://www.airs.com/blog/archives/277
@Jxck
Jxck / .gitignore
Last active December 18, 2015 19:09
blog sample advanced go concurrency pattern
.DS_Store
@Jxck
Jxck / testcase.1.txt
Last active December 22, 2015 12:49
HPAC の Encoding 戦略の考察
全て Without Indexing で送るパターン
HT を更新しない。
結果的には :scheme, :method くらいしか使いまわさないパターン。
[1]
HeaderSet
:scheme: https
:host: jxck.io
@Jxck
Jxck / tfo-client.py
Created December 8, 2013 09:09
TCP Fast Open – Webを速くするためにGoogleがやっていること Make the Web Faster 4 - Python サンプルコード
import sys, socket
'''
tcp fast open server sample code
execute it before enable tfo flag
$ echo 3 | sudo tee /proc/sys/net/ipv4/tcp_fastopen
'''
PORT = 80
MSG_FASTOPEN = 0x20000000
@Jxck
Jxck / generator.js
Created January 11, 2014 10:49
next() の挙動がよくわからない。
function* generator() {
console.log(yield 1);
console.log(yield 2);
console.log(yield 3);
return 4;
}
var g = generator();
console.log(g.next(0)); // この 0 を取る方法は?
console.log(g.next(10));
@Jxck
Jxck / a.txt
Last active November 11, 2019 23:18
ジェネレータの解説と非同期への適用 完成品 http://jxck.hatenablog.com/entry/2014-01-12/generator-screencaset
b.txt