Skip to content

Instantly share code, notes, and snippets.

@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@thesamet
thesamet / ReverseProxy.scala
Created November 5, 2014 23:36
Reverse-proxy in Play!
def reverseProxy = Action.async(parse.raw) {
request: Request[RawBuffer] =>
// Create the request to the upstream server:
val proxyRequest =
WS.url("http://localhost:8887" + request.path)
.withFollowRedirects(false)
.withMethod(request.method)
.withVirtualHost("localhost:9000")
.withHeaders(flattenMultiMap(request.headers.toMap): _*)
.withQueryString(request.queryString.mapValues(_.head).toSeq: _*)
// you must add this line to the build.scala :: play.Project(.........).settings(....)
// .settings(aspectjSettings: _*).settings(inputs in Aspectj <+= compiledClasses,products in Compile <<= products in Aspectj, products in Runtime <<= products in Compile)
package filters;
import models.User;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
@minosiants
minosiants / gist:3163791
Created July 23, 2012 14:06
Akka EventBus simple example
package com.minosiants
import akka.event.ActorEventBus
import akka.event.LookupClassification
import akka.actor.ActorSystem
import akka.actor.Props
import akka.actor.Actor
import java.util.Date
import java.util.UUID
@dshaw
dshaw / application.js
Created June 8, 2011 17:43 — forked from fabware/application.js
socket.io application and haproxy configuration
var express = require('express');
var redis = require('redis');
const serverType = process.argv[2];
const serverHost = process.argv[3];
const serverPort = parseInt(process.argv[4]);
const redisPort = 6379;
const redisHost = '127.0.0.1';