Skip to content

Instantly share code, notes, and snippets.

View EdgeCaseBerg's full-sized avatar
📉
Wondering why Github added statuses instead of something useful

Ethan EdgeCaseBerg

📉
Wondering why Github added statuses instead of something useful
View GitHub Profile
@EdgeCaseBerg
EdgeCaseBerg / how to fix.md
Created December 19, 2017 16:59
How to fix reactive mongo playframework dependency issue when (trying) using 12.6

Getting this?

java.lang.NoSuchMethodError: play.api.libs.iteratee.Execution$Implicits$.trampoline()Lscala/concurrent/ExecutionContext;

Is your build.sbt including a dependency like this?

"org.reactivemongo" %% "play2-reactivemongo" % "0.12.6-play24"
@EdgeCaseBerg
EdgeCaseBerg / VimeoClient.scala
Last active April 9, 2018 18:28
How to use Vimeo API from Scala
import com.vimeo.networking._
import com.vimeo.networking.model._
import com.vimeo.networking.model.error.VimeoError;
import com.vimeo.networking.callbacks._
import java.io.File
import scala.concurrent.{Future, Promise}
import scala.reflect.ClassTag
import scala.reflect._
import okhttp3.CacheControl
@EdgeCaseBerg
EdgeCaseBerg / caseInsensitive.sense
Last active May 11, 2018 20:40
Case Insensitive ElasticSearch Regular expressions
# Delete any old test index
DELETE example_copy
# Create index with appropriate mappings/settings
# Note that the pattern is meant to not match anything so that the entire field is taken as the "token"
PUT example_copy
{
"settings": {
"analysis": {
@EdgeCaseBerg
EdgeCaseBerg / makeZip.scala
Last active July 2, 2018 16:29
How to make a zip file in scala (Java 8)
import java.io.FileOutputStream
import java.nio.file.{Files, Paths, Path, FileVisitResult}
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.SimpleFileVisitor
def autoClosing[C <: Closeable, T](closeable: C)(c: C => T) = {
try {
c(closeable)
} finally {
closeable.close()
@EdgeCaseBerg
EdgeCaseBerg / WSClientBackend.scala
Last active October 16, 2018 20:01
WSClient powered backend for sttp.
package module
/* Don't import ._ because there's naming conflicts between sttp and ws for request bodies and whatnot */
import play.api.libs.ws
import ws.{ WSClient, WSClientConfig, WSRequest, WSResponse }
import play.api.libs.iteratee.Enumerator
import com.softwaremill.sttp._
import com.softwaremill.sttp.internal.SttpFile
import com.softwaremill.sttp.monadSyntax._