Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
case class ErrorMessage(message: String, cause: String) | |
object ErrorMessage { | |
import spray.json.DefaultJsonProtocol._ | |
implicit val errorFormat = jsonFormat2(ErrorMessage.apply) | |
} | |
import spray.httpx.SprayJsonSupport._ | |
implicit val jsonRejectionHandler = RejectionHandler { | |
case MalformedRequestContentRejection(msg, cause) :: Nil => | |
complete(StatusCodes.BadRequest, ErrorMessage("The request content was malformed", msg)) |
package wrappers | |
import play.api._ | |
import play.api.mvc._ | |
import scala.concurrent._ | |
import scala.concurrent.Future | |
import play.mvc.Http.Status | |
import ExecutionContext.Implicits.global | |
import play.libs.Akka | |
import akka.actor.{Actor, Props} |
import scala.annotation.tailrec | |
import scala.App | |
object Test extends App { | |
val NumberOfRepetitions = 20 | |
val longText = "This is a test text containing something and SoMETHING else." * 10000 | |
println(s"Ready to start. Text size ${longText.length}") |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
#!/usr/bin/env python | |
# based on cb-exit used in CrunchBang Linux <http://crunchbanglinux.org/> | |
import pygtk | |
pygtk.require('2.0') | |
import gtk | |
import os | |
import getpass |
class MyManagedResource extends ResourceController[String] { | |
def index = Action(Ok("index")) | |
def newScreen = Action(Ok("new")) | |
def create = Action { | |
Redirect(MyInjectableResource.reverseRoutes.index()) | |
} | |
def show(id: String) = Action(Ok("Show " + id)) |
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| FUCKIN PUSSIES | |
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
13:16 <luite> | hello | |
13:16 <ChongLi> | somebody has a mental illness! | |
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| compelled to write Node.js! | |
13:16 <genisage> | hi | |
13:16 <luite> | you might be pleased to learn that you can compile | |
| haskell to javascript now |
/* Define two variables as the loop limits */ | |
@from : 0; | |
@to : 10; | |
/* Create a Parametric mixin and add a guard operation */ | |
.loop(@index) when(@index =< @to) { | |
/* As the mixin is called CSS is outputted */ | |
div:nth-child(@{index}) { | |
top: unit(@index * 100, px); |
// create an index with an analyzer "myindex" | |
curl -X PUT localhost:9200/myindex -d ' | |
{ | |
"settings" : {` | |
"index":{ | |
"number_of_replicas":0, | |
"number_of_shards":1, | |
"analysis":{ | |
"analyzer":{ | |
"first":{ |