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
object Examples { | |
val validAcl1 = AclBinding(ResourcePattern(ResourceType.TOPIC, "position-report", PatternType.LITERAL), AclEntry("User:andrea", "example.cloud", Operation.ALL, PermissionType.ALLOW)) | |
val validAcl2 = AclBinding(ResourcePattern(ResourceType.CLUSTER, "kafka-test-", PatternType.PREFIXED), AclEntry("Group:testers", "example.cloud1", Operation.DESCRIBE, PermissionType.ALLOW)) | |
val invalidAcl = AclBinding(ResourcePattern(ResourceType.TRANSACTION_ID, "*", PatternType.LITERAL), AclEntry("User:andrea", "cloud1", Operation.ALTER, PermissionType.ALLOW)) | |
} |
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 io.circe.generic.semiauto.deriveCodec | |
import io.circe.Codec | |
final case class ResourcePattern(resourceType: ResourceType, | |
resource: String, | |
patternType: PatternType) | |
object ResourcePattern { | |
implicit val codec: Codec[ResourcePattern] = deriveCodec | |
} |
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 typeformation.cf.iam | |
import org.scalactic.TypeCheckedTripleEquals | |
import org.scalatest.{FreeSpec, Matchers} | |
/** | |
* Encoding of AWS IAM conditions using a combination of phantom types and type members | |
* | |
* A `Condition` is a type representing a key, and an expected parametric value. | |
* Conditions might be universally or existentially quantified, and can present an additional |
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 shapeless._ | |
import shapeless.labelled._ | |
trait Required[A] { | |
def isRequired: Boolean | |
} | |
object Required { | |
implicit def optIsRequired[A]: Required[Option[A]] = new Required[Option[A]] { | |
override def isRequired = false | |
} |
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 swag | |
import com.typesafe.config.Config | |
import shapeless._ | |
import shapeless.labelled._ | |
object FromConfig { | |
sealed trait Error |
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
### Keybase proof | |
I hereby claim: | |
* I am afiore on github. | |
* I am afiore (https://keybase.io/afiore) on keybase. | |
* I have a public key ASDOj-CbhhpO4ZN_j4oJ3sfPi6BZfaPqP3_t_9XD_nQ9Pgo | |
To claim this, I am signing this object: |
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 org.kohsuke.github.{GHCommitState, GHCommitStatus, GitHub} | |
name := "gitStatus" | |
version := "1.0" | |
scalaVersion := "2.11.8" | |
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.6" % "test" |
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 Function.const | |
import scala.annotation.tailrec | |
import scala.collection.SortedMap | |
object Palindrome { | |
case class Palindrome(s: String, startIdx: Int) | |
case class PalKey(index: Int, length: Int) | |
type PalIndex = SortedMap[PalKey, Int] | |
object Palindrome { |
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 pt.akka.workshop | |
import java.util.UUID | |
import akka.actor.{ActorLogging, Actor} | |
import akka.persistence.{RecoveryCompleted, SnapshotOffer, PersistentActor} | |
/* |
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
require 'nokogiri' | |
NewerOlder