This file contains hidden or 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 qualified Data.Map as DM | |
| data Product = Product String Float deriving (Show) | |
| type ProductMap = DM.Map String [Product] | |
| type DiscountTimes = (ProductMap -> Int) | |
| data Discount = Discount Float DiscountTimes | |
| products :: [Product] | |
| products = milk ++ marsBars | |
| where milk = replicate 7 $ Product "milk" 1.30 |
This file contains hidden or 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 php | |
| <?php | |
| /*** | |
| * PageSnap | |
| * | |
| * Script for archiving a HTML page (and associated media assets) into a single file. | |
| * | |
| * Requires: | |
| * |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 qualified Data.ByteString.Lazy as BSL | |
| import Control.Monad | |
| import Control.Monad.Trans | |
| import Control.Monad.Trans.Resource | |
| import Control.Concurrent | |
| import Control.Concurrent.Chan | |
| import qualified Network.HTTP.Conduit as C | |
| import Network.HTTP.Types (Status(..)) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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" |
NewerOlder