This file contains hidden or 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
| go run $(go env GOROOT)/src/crypto/tls/generate_cert.go --host localhost |
This file contains hidden or 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
| import asyncio | |
| import websockets | |
| from websockets.exceptions import ConnectionClosed | |
| from jsonrpc import JSONRPCResponseManager, dispatcher | |
| @dispatcher.add_method | |
| def hello(*params): | |
| return 'hello'+repr(params) |
This file contains hidden or 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 ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) | |
| func BenchmarkGo(n int) time.Duration { | |
| ch := make(chan time.Duration, n) |
This file contains hidden or 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
| xcode-select --install | |
| go get -d github.com/derekparker/delve | |
| # dlv-certという名前でコード署名証明書の作成とコード署名として常に信頼する。 | |
| cd $GOPATH/src/github.com/derekparker/delve | |
| GO15VENDOREXPERIMENT=1 CERT=dlv-cert make install | |
| sudo killall taskgated | |
| dlv debug |
This file contains hidden or 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 ( | |
| "crypto/tls" | |
| "encoding/json" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
This file contains hidden or 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 の GC 以下のコマンドをsystemdのtimerか、crondにセット | |
| $(docker ps -f status=exited -q) | xargs -r docker rm; $(docker images --filter "dangling=true" -q) | xargs -r rmi | |
| # go-1.6.2 をdocker経由で使う。本物と違うのは$PWDより親フォルダにアクセスできない(/tmpも) | |
| alias go='docker run -it -v $PWD:$PWD -w $PWD golang:1.6.2-alpine go' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > /tmp/install.sh | |
| sudo bash /tmp/install.sh -b -p /opt/python | |
| echo "PATH=/opt/python/bin:\$PATH" >> ~/.bashrc |
This file contains hidden or 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
| sudo pacman -S musl | |
| CC=/usr/bin/musl-gcc go build --ldflags '-linkmode external -extldflags "-static"' sample.go | |
| ldd sample | |
| 動的実行ファイルではありません |