Skip to content

Instantly share code, notes, and snippets.

@worthlesscog
worthlesscog / gist:3060273
Created July 6, 2012 13:53
Polymorphic JSON unmarshall with Jackson in Scala
import org.codehaus.jackson.annotate.{ JsonTypeInfo, JsonSubTypes, JsonProperty }
import org.codehaus.jackson.annotate.JsonSubTypes.Type
import org.codehaus.jackson.map.ObjectMapper
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes(Array(
new Type(value = classOf[Bingo], name = "x"),
new Type(value = classOf[Bongo], name = "y"),
new Type(value = classOf[Bungo], name = "z")
))
@terrancesnyder
terrancesnyder / setenv.sh
Created May 23, 2011 00:07
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft