Skip to content

Instantly share code, notes, and snippets.

{
"resourceKeyValues": {
"EDE_PROPERTY_ADDRESS": "999 Pine Ave."
},
"symbolValues": {
"view_1.disclaimer_1": "Guaranteed or Your Money Back",
"agent_1.photo_1": "http://acme-broker.example.com/agents/agent-1.jpg"
}
}
@laser
laser / BigData.scala
Created October 15, 2015 19:03 — forked from davegurnell/BigData.scala
Slick database mapping of >22 columns using HLists
import slick.driver.MySQLDriver.simple._
import scala.slick.collection.heterogenous._
import scala.slick.collection.heterogenous.syntax._
import scala.slick.jdbc._
// This is the large case class we are mapping -- 25 string fields:
case class BigData(
field1: String,
field2: String,
field3: String,
@laser
laser / gist:7647d1d10d04c2510a57
Last active September 15, 2015 03:03 — forked from cvogt/gist:9239494
Slick app architecture cheat sheet
// Please comment in case of typos or bugs
import scala.slick.driver.H2Driver._
val db = Database.for...(...)
case class Record( ... )
class Records(tag: Tag) extends Table[Record](tag,"RECORDS"){
...
def * = ... <> (Record.tupled,Record.unapply)
// place additional methods here which return values of type Column
app.get('/proxied_image/:image_url', function(request_from_client, response_to_client){
sys.puts("Starting proxy");
var image_url = request_from_client.params.image_url;
var image_host_name = url.parse(image_url).hostname
var filename = url.parse(image_url).pathname.split("/").pop()
var http_client = http.createClient(80, image_host_name);
var image_get_request = http_client.request('GET', image_url, {"host": image_host_name});
image_get_request.addListener('response', function(proxy_response){