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
> 15.toString() | |
SyntaxError: Unexpected token ILLEGAL | |
> 15..toString() | |
"15" |
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
upstream domain { | |
server 127.0.0.1:3001; | |
} | |
server { | |
listen 80; | |
server_name domain.io another.domain.io; | |
return 301 http://main.domain.com$request_uri; | |
} | |
server { | |
listen 80; |
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
<div class="basket"> | |
<div class="buttons"> | |
<button class="fewer" class="{{#if getQuantity this ../../../basket == 0}}hide{{/if}}">-</button> | |
<div class="quantity" class="{{#if getQuantity this ../../../basket == 0}}hide{{/if}}">{{ getQuantity this ../../../basket }} x</div> | |
<button class="more">{{ currency this.pricePerUnit }}</button> | |
</div> | |
</div> |
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
getNestedDataBetter: function (){ | |
//create your deferred promise. | |
var deferred = $q.defer(); | |
//do your thing. | |
$http.get('parents.json') | |
.then(function(result){ | |
var parents = result.data; | |
$http.get('children.json') | |
.then(function(result) { |
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) | |
} |
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
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
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
$ 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
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) |
OlderNewer