Skip to content

Instantly share code, notes, and snippets.

Hiroaki Nakamura hnakamur

Block or report user

Report or block hnakamur

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
@hnakamur
hnakamur / bench_test.go
Created Oct 3, 2019
Go benchmark StringBuilder with Fprintf
View bench_test.go
package main
import (
"fmt"
"strconv"
"strings"
"testing"
)
func dummy(s string) {}
@hnakamur
hnakamur / main.go
Created Sep 27, 2019
go exponential random distribution example
View main.go
package main
import (
crand "crypto/rand"
"encoding/binary"
"fmt"
"time"
"golang.org/x/exp/rand"
"gonum.org/v1/gonum/stat/distuv"
@hnakamur
hnakamur / index.html
Last active May 27, 2019
cytoscape network weathermap experiment
View index.html
<!DOCTYPE>
<html>
<head>
<title>network weathermap demo using cytoscape.js</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<script src="https://unpkg.com/cytoscape/dist/cytoscape.min.js"></script>
<script src="https://unpkg.com/cytoscape-automove@1.10.1/cytoscape-automove.js"></script>
<style>
#cy {
position: absolute;
@hnakamur
hnakamur / main.go
Created Mar 9, 2018
a go example for waiting file lock, based on github.com/lomik/go-carbon
View main.go
package main
import (
"flag"
"fmt"
"log"
"os"
"syscall"
"time"
)
@hnakamur
hnakamur / index.html
Created Sep 18, 2017
await in loop experiment
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Async await loop experiment</title>
<script>
function foo(i) {
return new Promise((resolve, reject) => {
console.log('foo', i);
resolve();
@hnakamur
hnakamur / memo.md
Last active May 27, 2019
badger, goleveldb, boltdb benchmark
View memo.md
hnakamur@express:~/go/src/github.com/zchee/go-benchmarks/db$ go test -count=10 -run='^$' -bench=. -benchmem
goos: linux
goarch: amd64
pkg: github.com/zchee/go-benchmarks/db
BenchmarkGetBadger-2             5000000               399 ns/op          22.50 MB/s          40 B/op          2 allocs/op
BenchmarkGetBadger-2             5000000               390 ns/op          23.04 MB/s          40 B/op          2 allocs/op
BenchmarkGetBadger-2             5000000               390 ns/op          23.03 MB/s          40 B/op          2 allocs/op
BenchmarkGetBadger-2             5000000               391 ns/op          22.97 MB/s          40 B/op          2 allocs/op
BenchmarkGetBadger-2             5000000               391 ns/op          22.96 MB/s          40 B/op          2 allocs/op
@hnakamur
hnakamur / benchmark_test.go
Created Jul 21, 2017
benchmark of github.com/ybubnov/go-uuid and github.com/google/uuid
View benchmark_test.go
package main
import (
"testing"
"github.com/google/uuid"
linuxuuid "github.com/ybubnov/go-uuid"
)
func BenchmarkLinuxKernelUUIDv4(b *testing.B) {
@hnakamur
hnakamur / etcd-config-memo.md
Last active Jul 3, 2017
etcd v3の設定メモ
View etcd-config-memo.md

etcd01:/etc/etcd/etcd.yaml

debug: true
name: etcd01
data-dir: /var/lib/etcd
initial-advertise-peer-urls: https://10.155.92.228:2380
listen-peer-urls: https://10.155.92.228:2380
advertise-client-urls: https://10.155.92.228:2379
listen-client-urls: https://10.155.92.228:2379
@hnakamur
hnakamur / index.html
Last active Jan 9, 2018
Noto Sans CJK JP local font and webfont experiment
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@font-face {
font-family: 'Noto Sans JP';
font-style: normal;
font-weight: 300;
src: local("Noto Sans CJK JP"),
/* NOTE: you need to use v5 (not v6) to have effect of font-feature-settings: "palt" */
url(//fonts.gstatic.com/ea/notosansjapanese/v5/NotoSansJP-Light.woff2) format('woff2'),
@hnakamur
hnakamur / memo.txt
Created Jun 23, 2017
trafficserverでis_response_cacheableの呼び出し元をたどるコードリーディング
View memo.txt
対象バージョンは6.2.0
bool
HttpTransact::is_response_cacheable(State *s, HTTPHdr *request, HTTPHdr *response)
の実装
https://github.com/apache/trafficserver/blob/6.2.0/proxy/http/HttpTransact.cc#L6127
is_response_cacheable の検索結果
```
You can’t perform that action at this time.