Skip to content

Instantly share code, notes, and snippets.

### DML ### THIS IS UNDER CONSTRUCTION!!!
# Keyspace Name
keyspace: bacon
# The CQL for creating a keyspace (optional if it already exists)
keyspace_definition: |
CREATE KEYSPACE bacon WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};
# Table name
create table website_hits(
full_url TEXT,
hit_date TIMESTAMP,
website_hit_id UUID,
PRIMARY KEY(full_url, hit_date, website_hit_id )
) WITH CLUSTERING ORDER BY (hit_date DESC);
insert into website_hits(full_url, hit_date, website_hit_id) values('www.foo.com', dateof(now()), uuid());
insert into website_hits(full_url, hit_date, website_hit_id) values('www.bar.com', dateof(now()), uuid());
2015-09-21 14:20:54,334 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-2
Cluster Node [akka.tcp://MySystem@UP.86:9010] - Starting up...
015-09-21 14:20:55,015 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-15
Cluster Node [akka.tcp://MySystem@IP.86:9010] - Registered cluster JMX MBean [akka:type=Cluster]
2015-09-21 14:20:55,018 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-15
Cluster Node [akka.tcp://MySystem@IP.86:9010] - Started up successfully
2015-09-21 14:20:55,093 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-15
2015-09-21 14:20:50,483 - [INFO] - from MySystem(akka://EsaleSystem) in EsaleSystem-akka.actor.default-dispatcher-7
MySystem Node [akka.tcp://MySystem@IP.85:9010] - Starting up...
2015-09-21 14:20:50,874 - [INFO] - from MySystem(akka://MySystem) in MySystem-akka.actor.default-dispatcher-6
MySystem Node [akka.tcp://MySystem@IP.85:9010] - Registered MySystem JMX MBean [akka:type=MySystem]
2015-09-21 14:20:50,879 - [INFO] - from MySystem(akka://MySystem) in MySystem-akka.actor.default-dispatcher-6
MySystem Node [akka.tcp://MySystem@IP.85:9010] - Started up successfully
2015-09-21 14:20:50,914 - [INFO] - from MySystem(akka://MySystem) in MySystem-akka.actor.default-dispatcher-4
2015-09-21 14:20:49,177 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-4
Cluster Node [akka.tcp://MySystem@IP.197:9010] - Starting up...
2015-09-21 14:20:49,503 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-2
Cluster Node [akka.tcp://MySystem@IP.197:9010] - Registered cluster JMX MBean [akka:type=Cluster]
2015-09-21 14:20:49,504 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-2
Cluster Node [akka.tcp://MySystem@IP.197:9010] - Started up successfully
2015-09-21 14:20:49,541 - [INFO] - from Cluster(akka://MySystem) in MySystem-akka.actor.default-dispatcher-2
// this works in play 2.4 with the 1.9.29 version of async http client
def securePostMultipart(requestPath: String, etsyToken: RequestToken,
fileName: String, file: File, fileMimeType: String,
stringParts: (String, String)*): Future[WSResponse] = {
val fullUrl = "http://foo/bar/zar"
val parts : List[Part] = List(
new FilePart(fileName, file, fileMimeType),
import org.joda.time.DateTime
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.concurrent.duration._
object FooBar {
trait BuildableCaseClass[T] {
def build(input: Seq[String]) : Either[T, Seq[ValidationError]]
}
trait PeepsCanValidateMe {
def validateMe() : Seq[ValidationError]
}
#!/usr/bin/env bash
### ------------------------------- ###
### Helper methods for BASH scripts ###
### ------------------------------- ###
die() {
echo "$@" 1>&2
exit 1
}