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
| func readLine(path string) { | |
| inFile, _ := os.Open(path) | |
| defer inFile.Close() | |
| scanner := bufio.NewScanner(inFile) | |
| scanner.Split(bufio.ScanLines) | |
| for scanner.Scan() { | |
| fmt.Println(scanner.Text()) | |
| } | |
| } |
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 run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
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
| require 'Benchmark' | |
| def balanced_delimiters?(text) | |
| openers = [] | |
| matchers = { | |
| ')' => '(', | |
| ']' => '[', | |
| '}' => '{' | |
| } | |
| text.chars.each do |char| |
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
| .PHONY: build doc fmt lint dev test vet godep install bench | |
| PKG_NAME=$(shell basename `pwd`) | |
| install: | |
| go get -t -v ./... | |
| build: vet \ | |
| test \ | |
| go build -v -o ./bin/$(PKG_NAME) |
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 test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt | |
| go tool pprof -http :8080 cpu.out | |
| go tool pprof -http :8081 mem.out | |
| go tool trace trace.out | |
| go tool pprof $FILENAME.test cpu.out | |
| # (pprof) list <func name> | |
| # go get -u golang.org/x/perf/cmd/benchstat | |
| benchstat bench.txt |
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
| #!/usr/bin/env ruby | |
| # <bitbar.title>Windfinder </bitbar.title> | |
| # <bitbar.version>v1.0</bitbar.version> | |
| # <bitbar.author>Gergő Sulymosi</bitbar.author> | |
| # <bitbar.author.github>trekdemo</bitbar.author.github> | |
| # <bitbar.desc>Show the 3 day forecast from Windfinder</bitbar.desc> | |
| # <bitbar.image></bitbar.image> | |
| # <bitbar.dependencies>ruby</bitbar.dependencies> | |
| # <bitbar.abouturl></bitbar.abouturl> |
OlderNewer