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 { | |
AccordionSummaryTypeMap, | |
AccordionTypeMap, | |
AppBarTypeMap, | |
AvatarGroupTypeMap, | |
AvatarTypeMap, | |
BackdropTypeMap, | |
BadgeTypeMap, | |
BottomNavigationActionTypeMap, | |
BottomNavigationTypeMap, |
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
type Curry<F> = F extends (arg: infer A, ...args: infer Rest) => infer R | |
? (arg: A) => Rest extends [any] ? Curry<(...args: Rest) => R> : R | |
: never; |
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
type PropertyType = "string" | "number" | "date"; | |
type LinkSchema = { incoming: string } | { outgoing: string }; | |
type PropertySchema = | |
| { nullable: PropertyType | [PropertyType] } | |
| { required: PropertyType | [PropertyType] }; | |
type NodeRefSchema<L> = ({ nullable: L } | { required: L | [L] }) & LinkSchema; | |
type FieldSchema<L> = PropertySchema | NodeRefSchema<L>; | |
type NodeSchema<L> = { [key: string]: FieldSchema<L> }; | |
type GraphSchema<L> = { [key: string]: NodeSchema<L> }; |
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
(def nnv | |
(memoize | |
(fn [n k] | |
(cond | |
(= k 0) 1 | |
(> (* 2 k) (+ 1 n)) 0 | |
(= (* 2 k) (+ 1 n)) 1 | |
:else (bigint | |
(+ (nnv (dec n) k) | |
(nnv (dec (dec n)) (dec k)))))))) |
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
(ns async | |
(:require [cloroutine.core]) | |
(:import (java.util.concurrent CompletableFuture) | |
(java.util.function BiConsumer) | |
(clojure.lang Var))) | |
(def ^:dynamic *coroutine*) | |
(def ^:dynamic *value*) | |
(def ^:dynamic *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
[ | |
{ | |
"when": "editorTextFocus && editorLangId == prolog", | |
"key": "alt+enter", | |
"command": "extension.multiCommand.execute", | |
"args": { | |
"sequence": [ | |
"workbench.action.files.save", | |
"workbench.action.terminal.focus", | |
{ |
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
(defn first-index [f coll] | |
(->> (map-indexed vector coll) | |
(filter (comp f second)) | |
(map first) | |
(first))) | |
(defn first-incable [v] | |
(or | |
(first-index | |
(fn [[a b]] (< (inc a) b)) |
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
FROM gradle:6.7.1-jdk11 as build | |
COPY . /neo4j-plugin | |
WORKDIR /neo4j-plugin | |
RUN gradle shadowJar | |
FROM neo4j:4.2 | |
COPY --from=build /neo4j-plugin/build/libs/*-all.jar /plugins/ | |
ENV NEO4J_dbms_security_procedures_allowlist=example.* |
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
FROM gradle:6.7.1-jdk11 AS deps | |
ENV GRADLE_USER_HOME=/gradle-home | |
ADD ./settings.gradle.kts /neo4j-plugin/settings.gradle.kts | |
ADD ./build.gradle.kts /neo4j-plugin/build.gradle.kts | |
WORKDIR /neo4j-plugin | |
RUN gradle build | |
RUN ls -a /gradle-home | |
FROM gradle:6.7.1-jdk11 as build | |
ENV GRADLE_USER_HOME=/gradle-home |
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
// Loop-recur enables recursive programming without the need of defining a recursive function | |
fun <A, R> loop(a: A, action: Loop1<A, R>.(A) -> R) = Loop1(action).recur(a) | |
class Loop1<A, R>(private val action: Loop1<A, R>.(A) -> R) { | |
fun recur(a: A) = action(a) | |
} | |
fun main() { | |
val n = readLine()!!.toInt() |
NewerOlder