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,
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 |
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)) |
#!/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 |
// 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, |
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,
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}") |
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} |
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)) |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import subprocess | |
__all__ = ["transform"] | |
__version__ = '0.3' | |
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>' | |
__url__ = 'http://github.com/cburgmer/upsidedown' |
// Using vars, lots of local mutation | |
def getThemVar(th:Throwable)={ | |
var now=th | |
var li=List[Throwable](now) | |
var cause=now.getCause | |
while (cause!=null){ | |
li=cause::li | |
now=cause | |
cause=now.getCause | |
} |