This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func copyNonZero(dst, src interface{}) { | |
dstVal := reflect.Indirect(reflect.ValueOf(dst)) | |
srcVal := reflect.Indirect(reflect.ValueOf(src)) | |
srcType := srcVal.Type() | |
for i := 0; i < srcType.NumField(); i++ { | |
srcField := srcType.Field(i) | |
dstField := dstVal.FieldByName(srcField.Name) | |
if dstField.IsValid() { | |
val := srcVal.Field(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/codegangsta/martini" | |
"github.com/golang/groupcache" | |
"github.com/hashicorp/memberlist" | |
"log" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template": "accesslog-*", | |
"mappings": { | |
"fluent": { | |
"properties": { | |
"host": { | |
"type": "string", | |
"index": "not_analyzed" | |
}, | |
"uri": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem install fluent-plugin-inline-classifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gsutil mb -l ASIA gs://docker-bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"os" | |
"testing" | |
"time" | |
"github.com/ugorji/go/codec" | |
"github.com/vmihailenco/msgpack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker exec -it influxdb bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm install webpack -g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun e2wm-frame-size-save () | |
(interactive) | |
(let ((file "~/.emacs.d/framesize.el") | |
(width (int-to-string (frame-parameter nil 'width))) | |
(height (int-to-string (frame-parameter nil 'height))) | |
(top (int-to-string (frame-parameter nil 'top))) | |
(left (int-to-string (frame-parameter nil 'left))) | |
buf beg line init-line) | |
(if (get-file-buffer (expand-file-name file)) | |
(setq buf (get-file-buffer (expand-file-name file))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo(object): | |
_d = {} | |
def __init__(self, *names): | |
for name in names: | |
self.add_property(name, name) | |
def add_property(self, name, value): | |
self._d[name] = value | |
def getter(self, value): |
OlderNewer