I hereby claim:
- I am fernandomora on github.
- I am fernandomora (https://keybase.io/fernandomora) on keybase.
- I have a public key ASDHsShMVZBYpBVEZpGPHFEpP5FJ5ZVE7WPrIfx4Q8QHbwo
To claim this, I am signing this object:
object Main extends App { | |
case class User(id: String, name: String) | |
val users = scala.collection.mutable.Map( | |
"1" -> User("1", "Fernando"), | |
"2" -> User("1", "Darren"), | |
) | |
object UserRepository { | |
def getUserById(id: String): Option[User] = { |
package com.intenthq.elasticsearchwriter.duration | |
import java.util.Locale | |
import java.util.concurrent.TimeUnit | |
import scala.concurrent.duration._ | |
object PrettyDuration { | |
private val abbreviate = Map( | |
NANOSECONDS -> "ns", |
import scala.collection.{immutable, mutable, GenTraversableOnce} | |
import scala.collection.generic.CanBuildFrom | |
object GroupableOps { | |
implicit class ToGroupable[A, Coll[X] <: GenTraversableOnce[X]](coll: Coll[A]) { | |
// https://github.com/scala/scala/blob/v2.13.0-M5/src/library/scala/collection/Iterable.scala#L578 | |
def groupMap[K, B, To](key: A => K)(f: A => B) | |
(implicit bf: CanBuildFrom[Coll[A], B, To]): immutable.Map[K, To] = { |
04523be71ff5c62fe068b27465ea3d3967803755a4a2656d2aa7c55cd8b21636ecb2bd44aa42b5a071c99e1f744adbff04d8cba00ff2265bbb8bb89320b3e8d875;GMadorell |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# check color support | |
colors=$(tput colors) | |
if (($colors >= 8)); then | |
red='\033[0;31m' | |
nocolor='\033[00m' | |
else | |
red= | |
nocolor= |
#!/usr/bin/env bash | |
read -e -s -p 'Password: ' password | |
echo $password |
import com.github.xiaodongw.swagger.finatra.{SwaggerSupport, SwaggerSupportBase} | |
import com.twitter.finagle.Filter | |
import com.twitter.finagle.http.{Request, Response} | |
import com.twitter.finatra.http.Controller | |
import io.swagger.models.Swagger | |
import io.swagger.models.Operation | |
trait SwaggerFilterSupport extends SwaggerSupport { self: Controller => | |
override protected implicit val swagger: Swagger |
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(buildTrustAllSSLContext(), NoopHostnameVerifier.INSTANCE); | |
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create().register("http", PlainConnectionSocketFactory.getSocketFactory()).register("https", sslsf).build(); | |
HttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(new DefaultHttpClientConnectionOperator(socketFactoryRegistry, null, null), null, -1, TimeUnit.MILLISECONDS); | |
HttpClientBuilder clientBuilder = HttpClients.custom(); | |
clientBuilder.setConnectionManager(cm); | |
class SniHttpClientConnectionOperator extends DefaultHttpClientConnectionOperator { | |
class SniSSLSocketFactory extends SSLConnectionSocketFactory { |