Skip to content

Instantly share code, notes, and snippets.

diff --git a/SConstruct b/SConstruct
index 1fd1e0f..3b58821 100644
--- a/SConstruct
+++ b/SConstruct
@@ -5,6 +5,11 @@ def build_sources(env, sources):
return [ env.SharedObject(s) for s in sources ]
# def
+v8cgi_bin = [];
+v8cgi_inc = [];
@easel
easel / vagrant.org
Created January 18, 2011 17:11 — forked from zellyn/vagrant.org
@easel
easel / Vagrantfile
Created January 19, 2011 20:36
puppet multi-vm vagrantfile for v0.7.0
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.define :fw do |fw_config|
fw_config.vm.box = "lucid64-puppet"
fw_config.vm.box_url = "https://someplace/lucid64-puppet.box"
fw_config.vm.forward_port "http", 80, 9080
2015-05-19 16:39:46 -0400
./autogen.sh
Generating configure files... may take a while.
configure.ac:11: installing './compile'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
@easel
easel / slick-traits.scala
Last active October 17, 2016 18:08
generic slick foreign key
object SlickGroupsDAO {
case class Item(
name: String,
parentId: Option[Long] = None,
ctime: Timestamp = new Timestamp(DateTime.now.getMillis),
mtime: Timestamp = new Timestamp(DateTime.now.getMillis),
id: Long = 1
) extends SlickDTO
}
@easel
easel / SlickContactDAO.scala
Created September 16, 2015 23:40
buffering and interleaving results
def streamByUserId(
userId: UserId,
meta: QueryMeta
): Future[StreamQueryResult[Contact]] = {
createFilteredStreamResult(queryByUserId(userId, Some(meta)), meta).map { result =>
var buffer: Seq[((ContactDTO, ContactPointDTO), ContactTypeDTO)] = Seq.empty
val reduced: Source[Contact, _] = result.stream.map { x =>
buffer.headOption match {
case Some(y) if y._1._1 == x._1._1 =>
buffer = buffer :+ x
@easel
easel / CirceBodyParser.scala
Created January 6, 2016 17:08
Circe Play Body Parser
import java.nio.ByteBuffer
import cats.data.Xor
import com.theseventhsense.utils.logging.Logging
import io.circe
import io.circe.{Decoder, Json}
import play.api.http.LazyHttpErrorHandler
import play.api.http.Status._
import play.api.libs.iteratee._
import play.api.mvc.BodyParsers.parse._
@easel
easel / CirceWritable.scala
Created January 6, 2016 17:09
Circe Play Writable's
object CirceWritable {
implicit def contentTypeOf_CirceJson(implicit codec: Codec): ContentTypeOf[io.circe.Json] = {
ContentTypeOf[io.circe.Json](Some(ContentTypes.JSON))
}
implicit def writeableOf_CirceJson(implicit codec: Codec): Writeable[io.circe.Json] = {
Writeable(obj => codec.encode(obj.noSpaces))
}
}
package com.theseventhsense.utils.akka
import akka.stream.stage._
import com.codahale.metrics.Histogram
object ObservableBuffer {
object FixedSizeBuffer {
/**
package com.theseventhsense.clients.wsclient
import akka.actor.{ Props, Status }
import akka.pattern.pipe
import akka.stream.actor.ActorPublisher
import com.theseventhsense.utils.persistence.Keyed
import scala.concurrent.ExecutionContext
class BatchSource[A <: Keyed](loader: BatchLoader[A])(implicit ec: ExecutionContext) extends ActorPublisher[A] {