This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit val trustfulSslContext: SSLContext = { | |
object WideOpenX509TrustManager extends X509TrustManager { | |
override def checkClientTrusted(chain: Array[X509Certificate], authType: String) = () | |
override def checkServerTrusted(chain: Array[X509Certificate], authType: String) = () | |
override def getAcceptedIssuers = Array[X509Certificate]() | |
} | |
val context = SSLContext.getInstance("TLS") | |
context.init(Array[KeyManager](), Array(WideOpenX509TrustManager), null) | |
context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit val system = ActorSystem("nwtel-cable-usage") | |
implicit val timeout = Timeout(60000) | |
import system.dispatcher | |
def extractSessionCookies(httpResponse: HttpResponse) = httpResponse.headers.collect { case `Set-Cookie`(hc) => Cookie(hc) } | |
val macAddress = "7CB21B9D69AE" | |
val query = for { | |
Http.HostConnectorInfo(connector, _) <- IO(Http) ? Http.HostConnectorSetup("apps.nwtel.ca", port = 443, sslEncryption = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.libs.json.Json | |
/** | |
* Created by svenasse on 20/05/14. | |
*/ | |
object MyOptions extends App { | |
case class Person(name: String, age: Int) | |
val request = """{"name": "John Doe", "age": 24}""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mixin | |
import collection._ | |
object Stacking1 extends App { | |
case class Company(id: String, name: String, address: String, active: Boolean) | |
case class ReferenceData(companies: Map[String, Company]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cs | |
import fixtures.Lookup.ReferenceDataBuilder | |
import org.scalatest._ | |
import com.wattex.api._ | |
import org.joda.time.LocalDate | |
import com.wattex.persistence.data.LookupData._ | |
class TradesSpec extends FlatSpec with CompanyA { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl._ | |
import org.apache.http.client.fluent.{Form, Request} | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{Await, Future} | |
import scala.util.matching.Regex | |
object Streaming extends App { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.cosa | |
import rx.lang.scala.subjects.{BehaviorSubject, PublishSubject} | |
object ConfigurationExample1 extends App { | |
val poleSubject = PublishSubject[String]() | |
val configurations = BehaviorSubject(Map.empty[Pole, Config]) | |
configurations.subscribe(x => println("Configurations: " + x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.all.min.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/rxjs-dom/7.0.3/rx.dom.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var items = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package http | |
import java.util.UUID | |
import akka.actor.ActorSystem | |
import akka.event.Logging | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model._ | |
import akka.http.scaladsl.server._ | |
import Directives._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from operator import itemgetter | |
import boto | |
import boto.ec2 | |
import boto.ec2.autoscale | |
from boto.exception import EC2ResponseError | |
import datetime | |
import os | |
import sys |
OlderNewer