Skip to content

Instantly share code, notes, and snippets.

a=String.fromCharCode(95);q=String.fromCharCode(34);v="console.log(`a=String.fromCharCode(95);q=String.fromCharCode(34);v=_${v}_; ${v.replace(a,q).replace(a,q)}`)"; console.log(`a=String.fromCharCode(95);q=String.fromCharCode(34);v="${v}"; ${v.replace(a,q).replace(a,q)}`)
@anton-kapelyushok
anton-kapelyushok / theonlysensiblething.kt
Last active July 16, 2021 10:10
The only sensible thing to do in kotlin
import com.tngtech.archunit.base.DescribedPredicate
import com.tngtech.archunit.core.domain.JavaClass
import com.tngtech.archunit.core.importer.ClassFileImporter
import com.tngtech.archunit.lang.ArchCondition
import com.tngtech.archunit.lang.ConditionEvents
import com.tngtech.archunit.lang.SimpleConditionEvent
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes
import org.junit.jupiter.api.Test
import org.springframework.stereotype.Component
import org.springframework.stereotype.Service
const True = (a, b) => a()
const False = (a, b) => b()
const If = (cond, then, else_ = () => {}) => cond(then, else_)
const L = (first, second) => second(first())
const Not = (bool) => (a, b) => bool(b, a)
const Or = (bool1, bool2) => (a, b) => bool1(a, () => bool2(a, b))
const And = (bool1, bool2) => (a, b) => bool1(() => bool2(a, b), b)
const Xor = (l, r) => Or(And(Not(l), r), And(l, Not(r)))
const Xnor = (l, r) => Not(Xor(l, r))