Skip to content

Instantly share code, notes, and snippets.

@dacr
dacr / zio-learning-json-2-cheat-sheet.sc
Last active March 30, 2025 08:17
ZIO learning - playing with json - zio-json cheat sheet / published by https://github.com/dacr/code-examples-manager #862c2592-c58c-4541-817b-eaf9da4c762e/8f61a19ede84238b6a1614dbdcf2aed8cfac5751
// summary : ZIO learning - playing with json - zio-json cheat sheet
// keywords : scala, zio, learning, json, pure-functional, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// license-url :
// id : 862c2592-c58c-4541-817b-eaf9da4c762e
// created-on : 2021-12-30T10:57:55+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@chadselph
chadselph / JacksonJsonSupport.scala
Created November 19, 2014 02:30
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
*/
@ScalaWilliam
ScalaWilliam / WSWithoutPlayApp.scala
Last active June 1, 2017 16:16
Running Play WS standalone, without a Play App. Works with Maven builds nicely. The top way to make REST calls in Scala, in my opinion.
package com.scalawilliam.example.play
import play.api.libs.ws._
/**
* Play's Scala WS library is very very cool. Provides you with plenty niceties.
* See more: https://www.playframework.com/documentation/2.3.x/ScalaWS
*
* Unfortunately it by default requires a Play application context.
* But you do not necessarily always want that.