Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sc6l6d3v on github.
  • I am henrykatz (https://keybase.io/henrykatz) on keybase.
  • I have a public key ASArpfviieGSfT2-GG3H7iOvUQqJt0nxLumMuHInIVY-Bwo

To claim this, I am signing this object:

import com.mohiva.play.silhouette.api.util.PasswordInfo
import com.mohiva.play.silhouette.password.BCryptSha256PasswordHasher
import org.mindrot.jbcrypt.BCrypt
class MyBCryptSha256PasswordHasher extends BCryptSha256PasswordHasher {
private val salt = BCrypt.gensalt(16)
override def hash(plainPassword: String) = {
PasswordInfo(
package iptv.datascience
package dash
import java.text.SimpleDateFormat
import com.sksamuel.elastic4s.http.HttpClient
import com.sksamuel.elastic4s.indexes.IndexDefinition
import com.sksamuel.elastic4s.{ElasticsearchClientUri, Indexable}
import io.circe._
import io.circe.generic.semiauto._
@sc6l6d3v
sc6l6d3v / CompletionExampleApp.scala
Created September 13, 2017 15:33
ES 5.4 Completion example using elastic4s DSL
package com.sksamuel.elastic4s.samples
import com.sksamuel.elastic4s.http.HttpClient
import com.sksamuel.elastic4s.{ArrayFieldValue, ElasticsearchClientUri, Indexable, SimpleFieldValue}
import org.elasticsearch.action.support.WriteRequest.RefreshPolicy
import scala.concurrent.duration.{Duration, _}
import scala.language.implicitConversions
object CompletionExampleApp extends App {
/**
* Created by hkatz on 11/1/16.
*/
import scala.pickling._
import scala.pickling.binary.{ BinaryPickle => bipck}
import scala.pickling.fastbinary.{ BinaryPickle => fbipck}
//import scala.pickling.json._
import scala.pickling.binary._
import java.io._
/**
* Created by hkatz on 11/1/16.
*/
import scala.pickling._
import scala.pickling.binary.{ BinaryPickle => bipck}
import scala.pickling.fastbinary.{ BinaryPickle => fbipck}
import scala.pickling.json._
import java.io._
package org.vz.watercourse.downstream
import akka.testkit._
import akka.actor.Actor._
import scala.util.{Failure, Success}
import akka.actor._
import org.vz.watercourse.common.model.domain.{Favorite, Purchase, ResumePoint}
import org.vz.watercourse.downstream.actors.lifecycle.Category
import org.vz.watercourse.downstream.runtime.{AppConfig, AppRuntime}
// this excerpt fails to locate actor using similar code for actorSelection()
class ReaderActorsSpec extends AbsBaseSpec with AppRuntime with AppConfig {
import scala.concurrent.ExecutionContext.Implicits.global
def findRef(path: String): Option[ActorRef] =
try {
Some(Await.result(rtSystem.actorSelection(s"/user/$path").resolveOne(1.second), 10.second))
} catch {
case ex: Throwable => None
}
// works perfectly in amm
import $ivy.`com.typesafe.akka::akka-actor:2.4.11`,akka.actor._, scala.concurrent._, scala.concurrent.duration._
val system = ActorSystem("hoge")
class PrintActor(dummy: String) extends Actor{ def receive = { case msg => println(msg) } }
val a = system.actorOf(Props(classOf[PrintActor],"first"),"aaa")
val b = system.actorOf(Props(classOf[PrintActor],"second"),"bbb")
Await.result(system.actorSelection("/user/aaa").resolveOne(1.second), 1.second)
{
def findRef(path: String): Option[ActorRef] =
try {