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 python3 | |
| from oso import Oso, Relation | |
| from dataclasses import dataclass | |
| from functools import partial | |
| policy = """ | |
| actor User { | |
| } |
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 python3 | |
| from oso import Oso, Relation | |
| from dataclasses import dataclass | |
| from functools import partial | |
| policy = """ | |
| actor User { | |
| relations = {groups: Group}; | |
| } |
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 python3 | |
| from oso import Oso, Relation | |
| from dataclasses import dataclass | |
| from functools import partial | |
| policy = """ | |
| actor User {} | |
| resource Group { | |
| relations = {network: Network}; |
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 forestry.rb | |
| (:require [clojure.core.match :refer [match]] | |
| [forestry.node :as n]) | |
| (:refer-clojure :exclude [find key val replace])) | |
| (defprotocol -RedBlackNode | |
| (color [node]) | |
| (blacken [node]) | |
| (-add [node k v]) | |
| (balance [node]) |
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 abci.example.kv | |
| (:require [abci.host :as host] | |
| [abci.host.middleware :as mw] | |
| [datahike.core :as dc] | |
| [datahike.tools :as d.tools] | |
| [datahike.api :as d] | |
| [konserve.core :as k] | |
| [hasch.core :as h] | |
| [taoensso.timbre :as log]) | |
| (:gen-class)) |
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 replicate.tree | |
| [clojure.walk | |
| :refer [postwalk]])) | |
| (defprotocol NodeStore | |
| (persist [store node]) | |
| (fetch [store node-hash])) | |
| (defprotocol Node | |
| (insert [node k store]) |
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 invariant.datahike-scratch | |
| (:refer-clojure :exclude [+]) | |
| (:require [invariant.datahike | |
| :refer [+]] | |
| [datahike.api :as d] | |
| [datahike.core :as dc])) | |
| (defn query [q conn tx] | |
| (d/q q | |
| @conn |
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
| ;; I would suggest that we use either 'datopia' or 'datopia.db' as the namespace | |
| ;; for the schemas, rather than 'db'. For users, I suspect 'db' will seem arbitrary | |
| ;; and incongruous (as it does to me, in this context). | |
| #:datopia {:attribute :datopia.ednt/balance | |
| :schema #:db {:cardinality :db.cardinality/one | |
| :valueType :db.type/bigdec} | |
| :invariant <inline query graph as map of keyword -> query, | |
| or maybe just inline query, initially. having |
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 stickler.core | |
| (:require [clojure.java.io :as io] | |
| [camel-snake-kebab.core :refer [->kebab-case]]) | |
| (:import [com.squareup.wire.schema Schema SchemaLoader ProtoType]) | |
| (:gen-class)) | |
| (def ^:dynamic package-renames {}) | |
| (def ^:dynamic ->field-name ->kebab-case) | |
| (def ^:dynamic ->type-name ->kebab-case) |
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 bash | |
| export DEBIAN_FRONTEND=noninteractive | |
| set -e | |
| sudo add-apt-repository universe | |
| apt-add-repository -y ppa:teejee2008/ppa | |
| apt-get update | |
| apt-get install -y ukuu |