Skip to content

Instantly share code, notes, and snippets.

View masahide's full-sized avatar

YAMASAKI Masahide masahide

View GitHub Profile
@sudix
sudix / bounded.go
Created April 2, 2014 07:13
Bounded parallelism [Go Concurrency Patterns: Pipelines and cancellation - The Go Blog](http://blog.golang.org/pipelines)
package main
import (
"crypto/md5"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
@sonots
sonots / fluentd_hacking_guide.md
Last active October 4, 2024 00:01
Fluentd ソースコード完全解説 (v0.10向け)

Fluentd ソースコード完全解説

英題:Fluentd Hacking Guide

目次

30分しかないため斜線部分は今回省く

  • Fluentd の起動シーケンスとプラグインの読み込み
  • Fluentd の設定ファイルのパース
  • Input Plugin から Output Plugin にデータが渡る流れ
@ninnemana
ninnemana / ganalytics.go
Created February 3, 2015 15:14
Example of routing analytics using the Measurement Protocol in golang
package main
import (
"net/http"
"net/url"
)
func main() {
vals := make(url.Values, 0)
@debedb
debedb / WrappedStreamingBody
Last active July 1, 2025 17:33
Wrap boto3's StreamingBody object to provide enough Python fileobj functionality fileobj functionality so that GzipFile is satisfied.
class WrappedStreamingBody:
"""
Wrap boto3's StreamingBody object to provide enough
fileobj functionality so that GzipFile is
satisfied. Sometimes duck typing is awesome.
@jriquelme
jriquelme / elastic_sample.go
Created November 29, 2019 15:14
Signing of Elastic requests (https://github.com/elastic/go-elasticsearch) according to AWS v4 Signing process
cfg, err := external.LoadDefaultAWSConfig()
if err != nil {
panic(err)
}
esCfg := elasticsearch.Config{
Transport: &awssigner.V4Signer{
RoundTripper: http.DefaultTransport,
Credentials: cfg.Credentials,
Region: cfg.Region,
},