Skip to content

Instantly share code, notes, and snippets.

@thiloplanz
thiloplanz / JacksonJsonSupport.scala
Last active December 18, 2015 11:05 — forked from chadselph/JacksonJsonSupport.scala
Spray JSON Support with Jackson
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
import spray.http.{ContentTypes, HttpCharsets, HttpEntity, MediaTypes}
import spray.httpx.marshalling.Marshaller
import spray.httpx.unmarshalling.Unmarshaller
/**
* Use Jackson directly to avoid json4s's dependencies
*/
@thiloplanz
thiloplanz / mersenne-twister.ts
Last active January 23, 2024 20:31 — forked from banksean/mersenne-twister.js
A TypeScript implementation of the Mersenne Twister pseudo-random number generator
/*
* TypeScript port by Thilo Planz
*
* https://gist.github.com/thiloplanz/6abf04f957197e9e3912
*/
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.