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
cd ~ | |
sudo yum update | |
sudo yum install java-1.7.0-openjdk.x86_64 -y | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.9.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
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
<match elasticsearch.system1.subsystem1.server1.**> | |
index_name system1 | |
type_name subsystem1 | |
type elasticsearch | |
include_tag_key true | |
tag_key @log_name | |
host xxx.xxx.xxx.xxx | |
port 9200 | |
logstash_format true | |
flush_interval 10s |
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 ( | |
"reflect" | |
"testing" | |
) | |
func BenchmarkSetIntMap(b *testing.B) { | |
m := make(map[int]bool) | |
for i := 0; i < b.N; 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 design // The convention consists of naming the design | |
// package "design" | |
import ( | |
. "github.com/goadesign/goa/design" // Use . imports to enable the DSL | |
. "github.com/goadesign/goa/design/apidsl" | |
) | |
var _ = API("cellar", func() { // API defines the microservice endpoint and | |
Title("The virtual wine cellar") // other global properties. There should be one | |
Description("A simple goa service") // and exactly one API definition appearing in |
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
version: 2 | |
jobs: | |
build: | |
working_directory: /go/src/github.com/your_company/your_app | |
docker: | |
- image: circleci/golang:1.10.0 | |
environment: | |
- GOCACHE: "/tmp/go/cache" | |
- DEP_VERSION: 0.4.1 | |
steps: |
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
version: 2 | |
jobs: | |
build: | |
working_directory: /go/src/github.com/your_company/your_app | |
docker: | |
- image: circleci/golang:1.10.0 | |
environment: | |
- DEP_VERSION: 0.4.1 | |
steps: | |
- run: git config --global url.ssh://[email protected]/your_company.insteadOf https://github.com/your_company |
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
version: 2 | |
jobs: | |
build: | |
working_directory: /go/src/github.com/your_company/your_app | |
docker: | |
- image: circleci/golang:1.10.0 | |
environment: | |
- GOCACHE: "/tmp/go/cache" | |
steps: |
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 ( | |
"fmt" | |
"github.com/kr/pretty" | |
) | |
type IntList []int |
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
type List(type T) []T | |
func (l *List(T)) Filter(func(T) bool) *List(T) | |
func (l *List(T)) Map(func(T) T) *List(T) | |
func main(){ | |
var l List{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} | |
l.Filter(func(i int) bool { |
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 generate(numRows int) [][]int { | |
ret := make([][]int, numRows) | |
for i := 1; i <= numRows; i++ { | |
ret[i-1] = make([]int, i) | |
ret[i-1][0], ret[i-1][i-1] = 1, 1 | |
for j := 2; j < i && j <= numRows-1; j++ { | |
ret[i-1][j-1] = ret[i-2][j-2] + ret[i-2][j-1] | |
} | |
} | |
return ret |
OlderNewer