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
hbs.registerHelper('if_eql', function(v1, v2, context) { | |
if(v1 === v2) { | |
return context.fn(this); | |
} | |
return context.inverse(this); | |
}); |
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
public class Hello1 | |
{ | |
public static void Main() | |
{ | |
System.Console.WriteLine("Hello, World!"); | |
} | |
} |
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
> ping 172.17.5.108 | |
PING 172.17.5.108 (172.17.5.108) 56(84) bytes of data. | |
64 bytes from 172.17.5.108: icmp_seq=1 ttl=64 time=0.094 ms | |
64 bytes from 172.17.5.108: icmp_seq=2 ttl=64 time=0.063 ms | |
64 bytes from 172.17.5.108: icmp_seq=3 ttl=64 time=0.063 ms | |
^C | |
--- 172.17.5.108 ping statistics --- | |
3 packets transmitted, 3 received, 0% packet loss, time 1999ms | |
rtt min/avg/max/mdev = 0.063/0.073/0.094/0.016 ms |
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
> var total = 0 | |
undefined | |
> total += 4.4 | |
4.4 | |
> total += 4.4 | |
8.8 | |
> total += 4.4 | |
13.200000000000001 | |
var total = 0.0 | |
undefined |
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
TheNewPretty:elasticsearch-1.3.4 ben$ ./bin/elasticsearch | |
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 51.0 | |
at java.lang.ClassLoader.defineClass1(Native Method) | |
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) | |
at java.lang.ClassLoader.defineClass(ClassLoader.java:621) | |
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) | |
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) | |
at java.net.URLClassLoader.access$000(URLClassLoader.java:58) | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:197) | |
at java.security.AccessController.doPrivileged(Native Method) |
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 run -d --name redis -p 6379 redis | |
d55a755b91c1ce040625c3843cb71a5f3f037ee456954af716df0e1f1005b232 | |
$ docker port redis 6379 | |
0.0.0.0:49154 |
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
du --max-depth=7 /* | sort -n |
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
curl -XPUT 'http://localhost:9200/twitter/twee.t/1' -d '{ | |
"user" : "kimchy", | |
"post_date" : "2009-11-15T14:12:12", | |
"message" : "trying out Elasticsearch" | |
}' | |
curl -X GET 'http://localhost:9200/twitter/_search?q=user:kimchy' | |
curl -X GET 'http://localhost:9200/twitter/twee.t/_search?q=user:kimchy' | |
curl -X GET 'http://localhost:9200/twitter/tw*/_search?q=user:kimchy' |
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
var prediction Prediction | |
get_resp := elasticsearch.Get(index, key) | |
if(get_resp == nil) { | |
prediction = Prediction {EventId: eventId, UserId: userid} | |
} else { | |
json.Unmarshal(*get_resp.Source, &prediction) | |
} | |
//cannot convert nil to type elasticsearch.ElasticGetResponse |
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 Get(id string, inter interface{}) { | |
baseUrl := "http://localhost:9200" | |
index := "fixtures" | |
url := fmt.Sprintf("%v/grandslam/%v/%v", baseUrl, index, id) | |
response, err := http.Get(url) | |
if err != nil { | |
fmt.Printf("Error: %s", err) | |
} |