This file contains 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
var API_KEY = "<your api key>" | |
function NUGPT(instructions, prompt, model) { | |
var payload = { | |
'model': (model || "gpt-3.5-turbo-0125"), | |
'messages': [ | |
{ | |
'role': 'system', | |
'content': instructions |
This file contains 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 jp-fsm {:init :uninitialized | |
:entity-type :journalpost | |
:state-field :journalpost/status | |
:states {:uninitialized {:transitions [{:event :oprettet | |
:target :udkast}]} | |
:udkast {:entities {:journalnote '...} | |
:transitions [{:event :lock | |
:target :laast} | |
{:event :update}]} | |
:laast {:transitions [{:event :open |
This file contains 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
(use '[specviz.graphviz]) | |
(def states {:no-warn {:missed-first-name :first-name-required | |
:missed-last-name :last-name-required | |
:missed-dob-day :dob-required | |
:missed-dob-month :dob-required | |
:missed-dob-year :dob-required | |
:missed-ssn-area :ssn-required | |
:missed-ssn-group :ssn-required | |
:missed-ssn-serial :ssn-required |
This file contains 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
<appender name="ALL_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<!-- Default encoder is ch.qos.logback.classic.encoder.PatternLayoutEncoder --> | |
<encoder> | |
<pattern>%date{HH:mm:ss.SSS} %-5level %logger{25}: %msg %X thread=%thread%n</pattern> | |
</encoder> | |
<!-- Default location of log file is log/all.log --> | |
<file>log/all.log</file> |
This file contains 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 user) | |
(require '[twou.centralpark.model.publish :as publish]) | |
(require '[clojure.string :as string]) | |
(require '[datomic.api :as d]) | |
;; Get all attributes | |
(def all-attrs (d/q '[:find [?name ...] | |
:where [?eid :db/ident ?name]] | |
(dev/db))) |
This file contains 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 vatican.schema | |
"Extract the schema from a Datomic database." | |
(:require [datomic.api :as d])) | |
(defn gen-mem-db-uri | |
"Generate a unique uri for use with an in-memory Datomic database." | |
[] | |
(str "datomic:mem://" (d/squuid))) | |
;; TODO: parameterize the partition |
This file contains 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 foo.saml | |
(:require | |
[clojure.spec :as s] | |
[clojure.string :as string] | |
[clojure.xml :as xml]) | |
(:import | |
(java.io ByteArrayInputStream))) | |
(s/def :sso/Binding #{"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"}) | |
(s/def :sso/attrs (s/keys :req-un [:sso/Binding ::Location])) |
This file contains 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 generate-order | |
[db taskdefs ref-kw] | |
(->> taskdefs | |
(map :db/id) | |
(workflow/sort-taskdefs db) | |
(map (fn [id] (d/entity db id))) | |
(map :task.def/id) | |
(map (fn [id] [ref-kw id])))) | |
(defn generate-order* |
This file contains 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
(deftest subscriptions-perf-test | |
(testing "subscriptions messages all received" | |
(let [broker (d/start-broker) | |
subs-count 10 | |
reply-tos (repeatedly subs-count #(a/chan 1024)) | |
group-code "foo" #_(generate-l85-uuid) | |
subs-str (str "group_s:" group-code) | |
test-record-count 10000 | |
subs-reply-count (atom 0)] |
This file contains 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 si.tmux | |
(:require [clojure.string :as str] | |
[si.data :as d])) | |
(defn ->ssh-cmd | |
"Create remote ssh command." | |
[ssh-user command host] | |
(str "ssh -t " ssh-user "@" host " \"" command "\"")) | |
(defn gen-conf |
NewerOlder