Skip to content

Instantly share code, notes, and snippets.

View jdelafon's full-sized avatar

Julien Delafontaine jdelafon

  • Lausanne, Switzerland
View GitHub Profile
@claudio-scandura
claudio-scandura / SseApp.scala
Last active June 10, 2021 12:22
Akka-http example of SSE using an Actor as the source of the events Stream.
import akka.actor.{Actor, ActorSystem, Props}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.sse.ServerSentEvent
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.stream._
import akka.stream.scaladsl.{BroadcastHub, Keep, Source, SourceQueueWithComplete}
import scala.concurrent.ExecutionContext.Implicits.global
@dtertman
dtertman / Dockerfile
Last active July 5, 2017 21:44
HTTPS working with grahamdumpleton/mod-wsgi-docker
FROM grahamdumpleton/mod-wsgi-docker:python-3.5
# set up your /app directory with your WSGI application here
# The host location where the private key and certificate will be found
# You could also inject the keys
VOLUME ["/app/keys"]
# Expose the HTTPS port
EXPOSE 443
@davegurnell
davegurnell / anorm.scala
Last active August 14, 2023 16:42
A short guide to Anorm
/*
Overview
--------
To run a query using anorm you need to do three things:
1. Connect to the database (with or without a transaction)
2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator
3. Call one of the methods on `SqlQuery` to actually run the query