Skip to content

Instantly share code, notes, and snippets.

View spinscale's full-sized avatar
💻

Alexander Reelsen spinscale

💻
View GitHub Profile
@spinscale
spinscale / output.txt
Created August 13, 2015 08:06
mvn dependency tree
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Elasticsearch Build Resources
[INFO] Elasticsearch Rest API Spec
[INFO] Elasticsearch Parent POM
[INFO] Elasticsearch Core
[INFO] Elasticsearch Distribution
[INFO] Elasticsearch with all optional dependencies
@spinscale
spinscale / query.json
Created July 10, 2015 14:04
filter broken
PUT /foo/bar/1
{
"field1" : "foo",
"field2" : "foo"
}
PUT /foo/bar/2
{
"field1" : "bar",
"field2" : "bar"
@spinscale
spinscale / Webserver.java
Created June 10, 2015 07:01
Undertow + jgroups-raft example
package de.spinscale.cluster;
import io.undertow.Undertow;
import io.undertow.server.handlers.PathTemplateHandler;
import io.undertow.util.HttpString;
import io.undertow.util.PathTemplateMatch;
import org.jgroups.JChannel;
import org.jgroups.raft.RaftHandle;
import org.jgroups.raft.blocks.ReplicatedStateMachine;
@spinscale
spinscale / app.js
Created January 11, 2015 21:43
simple flash scope using expressjs
// poor mans flash scope
// message appears once, but reloading in the browser makes it vanish
app.use(function(req, res, next){
if (req.session.message !== null) {
res.locals.message = req.session.message
req.session.message = null
}
next();
});
@spinscale
spinscale / readme.md
Created July 24, 2014 07:07
Using iTerm2 notification capabilities

Notification of finished builds in iTerm2

iTerm2 has a neat feature called a trigger, which you can use to notify you about finished maven builds (failure or success) or anything else happening in your console.

Install terminal notifier

brew install terminal-notifier
# GET ES
# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.1.zip
# Unzip it
# unzip elasticsearch-1.2.1.zip
# cd elasticsearch-1.2.1
# Look around
# Show structure
@spinscale
spinscale / gist:5466258
Created April 26, 2013 10:09
Geo location reproduction.
curl -X PUT localhost:9200/geotest/
curl -X PUT localhost:9200/geotest/geotest/_mapping -d '{
"geotest": {
"properties": {
"location": {
"type": "geo_point",
"lat_lon": true,
"geohash": true
}
@spinscale
spinscale / install-elasticsearch.sh
Created April 8, 2013 12:13
Create an elasticsearch specific versioned instance quickly
#!/bin/bash
set -e
if [ "x$1" == "x-h" ] ; then
echo "Usage: $0 version destdir plugins"
exit
fi
CURRENT="0.90.0.RC1"
@spinscale
spinscale / gist:4713676
Created February 5, 2013 10:45
spark-groovy-jrebel-setup
-Drebel.plugins=/path/to/jrebel-spark-plugin/target/jrebel-plugin-spark-0.1-SNAPSHOT.jar
-Drebel.jr-spark-groovy=true
-Drebel.spark.app.class=de.spinscale.spark.WebServer
-Drebel.spark.app.method=init
@spinscale
spinscale / gist:4713674
Created February 5, 2013 10:45
spark-groovy-jrebel-curl
# curl -v -X POST localhost:4567/login/foo
> POST /login/foo HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: localhost:4567
> Accept: */*
>
< HTTP/1.1 204 No Content
< Set-Cookie: JSESSIONID=1pouphqxh5z3l1pusx23ewksw6;Path=/
< Expires: Thu, 01-Jan-1970 00:00:00 GMT