Skip to content

Instantly share code, notes, and snippets.

Mark Feeney overthink

Block or report user

Report or block overthink

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
viktorklang / ScalaEnum.scala
Created Jun 30, 2011
DIY Scala Enums (with optional exhaustiveness checking)
View ScalaEnum.scala
trait Enum { //DIY enum type
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia
type EnumVal <: Value //This is a type that needs to be found in the implementing class
private val _values = new AtomicReference(Vector[EnumVal]()) //Stores our enum values
//Adds an EnumVal to our storage, uses CCAS to make sure it's thread safe, returns the ordinal
private final def addEnumVal(newVal: EnumVal): Int = { import _values.{get, compareAndSet => CAS}
val oldVec = get
karmi /
Created Apr 8, 2011
Field notes gathered during installing and configuring ElasticSearch for
View Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

You can’t perform that action at this time.