View client.scala
object Foo {
def withTls(hostname: String, ciphers: Array[String]): Client = {
val socketAddressToEngine: SocketAddress => Engine = {
case sa: InetSocketAddress =>
val c = Ssl.client(hostname, sa.getPort)
c.self.setEnabledCipherSuites(ciphers)
c
case _ =>
val c = Ssl.client()
c.self.setEnabledCipherSuites(ciphers)
View HttpProxyConnectHandler.scala
package com.twitter.finagle.netty3.proxy
import com.twitter.finagle._
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.client.Transporter.Credentials
import com.twitter.io.Charsets
import com.twitter.util.Base64StringEncoder
import java.net.{InetSocketAddress, SocketAddress}
import java.util.concurrent.atomic.AtomicReference
View Weird.scala
// Scala 2.11.6-2.11.8
object WeirdCompileError {
import java.util
import javax.servlet.http.HttpServletRequest
// In HttpServletRequest: public Enumeration<String> getHeaderNames();
// http://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getHeaderNames--
// Error
View Test.java
import com.twitter.util.Function;
public class Test {
public void test() {
final PartialFunction<Tuple2<Object, Try<Response>>, scala.Boolean> decider =
new Function<Tuple2<Object,Try<Response>>, Boolean>() {
@Override
public scala.Boolean apply(Tuple2<Object, Try<Response>> v1) {
if (v1._2().isReturn()) {
View FailoveringService.scala
/**
* Wraps two services in a new service which checks whether the {{primaryService}} is
* available and uses it when it is available. Otherwise, it will use the {{backupService}}.
*/
class FailoveringService[Req, Rep](primaryService: Service[Req, Rep],
backupService: Service[Req, Rep])
extends Service[Req, Rep] {
override def apply(request: Req) =
View Convert.java
import com.twitter.finagle.Service;
import com.twitter.util.Future;
import com.twitter.util.Promise;
import rx.Observable;
import rx.Observer;
import rx.Subscription;
public class Convert {
static public <Res> Future<Res> fromObservable(final Observable<Res> observable) {
View NackTest.scala
package com.twitter.finagle.httpx
import com.twitter.finagle._
import com.twitter.util.{Await, Future}
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{FunSuite, ShouldMatchers}
import scala.compat.Platform
View Generator.scala
package nl.spockz.spray.routing.generator
import spray.routing.Route
object Generator {
def fromJaxRsAnnotatedPackage(packageName: String) : Route = _ => Unit
}
View gist:4ada61f73fb50129aa5a
Section *cycling = [[Section alloc] initWithName:@"fietsen" NamedThumb:@"Icon_fietsen.png" andDataURL:@"http://parklingezegen.nl/category/fietsroutes/?json=1"];
Section *walking = [[Section alloc] init];
walking.name = @"wandelen";
walking.thumb = [UIImage imageNamed:@"Icon_wandelen.png"];
walking.dataUrl = [NSURL URLWithString:@"http://parklingezegen.nl/category/wandelen/?json=1"];
View gist:9023172
Running "recess:bootstrap" (recess) task
>> Parser error in bootstrap/less/mixins.less
>> 643. padding-right: (@grid-gutter-width / 2);
>> 644. &:extend(.clearfix all);
>> 645. }
Warning: Use --force to continue.