Skip to content

Instantly share code, notes, and snippets.

{% if page.faqSchema %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{% for faq in page.faqSchema %}
{
"@type": "Question",
"name": "{{faq.title}}",
<picture>
<source srcset="{{ site.data.sidebar.author_image_webp }}" type="image/webp">
<source srcset="{{ site.data.sidebar.author_image }}" type="image/jpeg">
<img src="{{ site.data.sidebar.author_image }}" alt="author" class="author">
</picture>
import com.amazonaws.auth.profile.ProfileCredentialsProvider
initscript {
dependencies {
classpath 'com.amazonaws:aws-java-sdk-core:1.11.5'
}
}
publishing {
repositories {
maven {
publishing {
repositories {
maven {
name "s3-repo"
url "s3://MY_BUCKET_NAME/maven-repo"
authentication {
awsIm(AwsImAuthentication)
}
}
}
object combineFieldValues extends Poly2 {
implicit def caseValidation = at[ValidatedNel[String, Boolean], ValidatedNel[String, Boolean]] ({
case (a,b) => a.combine(b)
})
val complex = ComplexElement(
value = List(
StringElement(value = "first element"),
StringElement(value = "second element")
)
)
import shapeless._
sealed trait DefaultValidation extends Poly1 {
object combine extends Poly2 {
implicit def caseValidation = at[Boolean, Boolean] (_ && _)
}
sealed trait DefaultValidation extends Poly1 {
implicit def default[T] = at[T](x => true)
}
object validates extends DefaultValidation {
implicit def caseValidated[A](implicit v: ValidatorTypeClass[A]) = at[A](x => v.validate(x))
}
everything(validates)(combine)(complex)
could not find implicit value for parameter v: ValidatorTypeClass[Element]
override def validate(a: ComplexElement): Boolean = a.value.forall(validateElement)