Skip to content

Instantly share code, notes, and snippets.


Jeb Beich jebberjeb

View GitHub Profile
View foo.clj
(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
View graphviz_fsm.clj
(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
jebberjeb / logback-partial.xml
Created January 12, 2017 22:05
Logback appender used with Stuart Sierra's
View logback-partial.xml
<appender name="ALL_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- Default encoder is ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<pattern>%date{HH:mm:ss.SSS} %-5level %logger{25}: %msg %X thread=%thread%n</pattern>
<!-- Default location of log file is log/all.log -->
View convert-kws.clj
(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]]
View schema.clj
(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
jebberjeb / saml.clj
Created September 27, 2016 18:46
Parse SAML metadata with clojure spec
View saml.clj
(ns foo.saml
[clojure.spec :as s]
[clojure.string :as string]
[clojure.xml :as xml])
( 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]))
View thread-transduce.clj
(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*
jebberjeb / test.clj
Created December 3, 2015 20:51
Subscriptions Data Test
View test.clj
(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)]
jebberjeb / tmux.clj
Last active September 10, 2015 18:01
View tmux.clj
(ns si.tmux
(:require [clojure.string :as str]
[ :as d]))
(defn ->ssh-cmd
"Create remote ssh command."
[ssh-user command host]
(str "ssh -t " ssh-user "@" host " \"" command "\""))
(defn gen-conf
jebberjeb /
Last active September 12, 2019 19:43
Vim Plugins w/ Scheme (Racket)

Vim + Racket

A less-known feature of Vim is support for Scheme, for scripting or otherwise. At the time of the original integration, the MZScheme package (a subset of PLTScheme) was used. Eventually, this became Racket. However, in Vim configuration, help, etc, mzscheme is referred to.

The following steps were performed on Ubuntu 14 Server, in order to compile Vim with Scheme support.


To determine whether Vim has been compiled with support for Scheme: