Skip to content

Instantly share code, notes, and snippets.

View maacl's full-sized avatar

Martin Clausen maacl

View GitHub Profile
@maacl
maacl / brew.txt
Created July 19, 2018 08:10
mention of brew in build dir
tests/CMakeFiles/libgit2_clar.dir/flags.make:4:# compile C with /home/linuxbrew/.linuxbrew/bin/cc
tests/CMakeFiles/libgit2_clar.dir/link.txt:1:/home/linuxbrew/.linuxbrew/bin/cc -D_GNU_SOURCE -Wall -Wextra -fvisibility=hidden -fPIC -Wno-missing-field-initializers -Wstrict-aliasing -Wstrict-prototypes -Wdeclaration-after-statement -Wshift-count-overflow -Wno-unused-function -g -D_DEBUG -O0 -rdynamic CMakeFiles/libgit2_clar.dir/main.c.o CMakeFiles/libgit2_clar.dir/clar_libgit2.c.o CMakeFiles/libgit2_clar.dir/clar_libgit2_trace.c.o CMakeFiles/libgit2_clar.dir/clar_libgit2_timer.c.o CMakeFiles/libgit2_clar.dir/clar.c.o CMakeFiles/libgit2_clar.dir/apply/fromdiff.c.o CMakeFiles/libgit2_clar.dir/apply/fromfile.c.o CMakeFiles/libgit2_clar.dir/attr/file.c.o CMakeFiles/libgit2_clar.dir/attr/flags.c.o CMakeFiles/libgit2_clar.dir/attr/ignore.c.o CMakeFiles/libgit2_clar.dir/attr/lookup.c.o CMakeFiles/libgit2_clar.dir/attr/repo.c.o CMakeFiles/libgit2_clar.dir/blame/blame_helpers.c.o CMakeFiles/libgit2_clar.dir/blame/buffe
➜ build cmake ..
-- The C compiler identification is GNU 5.5.0
-- Check for working C compiler: /home/linuxbrew/.linuxbrew/bin/cc
-- Check for working C compiler: /home/linuxbrew/.linuxbrew/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Looking for pthread.h
@maacl
maacl / build.edn
Last active June 16, 2018 15:24
cljs webpack prosemirror
{:main hello-webpack.core
:output-to "out/main.js"
:output-dir "out"
:infer-externs true
:npm-deps false
:foreign-libs [{:file "dist/index_bundle.js"
:provides ["prosemirror-state"]
:global-exports {prosemirror-state ProseMirrorState}}]}
@maacl
maacl / core.clj
Last active January 29, 2023 07:07
Domain Modelling using Clojure
(ns pms.core
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]))
(comment "This is a small experiment inspired by Oskar Wickströms
excellent work at
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. I
wanted to see what would be involved in building the equivalent
functionality in reasonably ideomatic Clojure. It is also my first
for (var i = 0; i < planets.length; i++) {
planets[i]=newPosition(planets[i], planets);
}
@maacl
maacl / rules.cljs
Last active June 8, 2017 14:56
precept expression reuse
(rule discretion-exercised-timely
[[?e0 :event/timestamp ?dt]]
[[?e0 :event/action ?action]]
[[?e1 :discretion/action ?action]]
[[?e1 :discretion/time-windows ?tws]]
[:test (dt-within-tws? ?dt ?tws)]
=>
(insert! [?e1 :discretion/status :exercised-timely]))
(rule discretion-exercised-untimely
(set-env!
:resource-paths #{"src" "html" "src/clj" "src/cljc"}
:dependencies '[[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[adzerk/boot-cljs-repl "0.3.0" :scope "test"]
[adzerk/boot-reload "0.4.5" :scope "test"]
[pandeiro/boot-http "0.7.1-SNAPSHOT" :scope "test"]
[crisptrutski/boot-cljs-test "0.2.2-SNAPSHOT" :scope "test"]
[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.228"]
[hiccups "0.3.0"]
CLJ:
```
➜ replikativ-demo git:(master) lein repl
nREPL server started on port 40024 on host 127.0.0.1 - nrepl://127.0.0.1:40024
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
OpenJDK 64-Bit Server VM 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)

Keybase proof

I hereby claim:

  • I am maacl on github.
  • I am maacl (https://keybase.io/maacl) on keybase.
  • I have a public key whose fingerprint is C27A 624F B588 C9E5 A87C 64EA 8964 3DFB CE73 B95E

To claim this, I am signing this object:

public static Document getXml (WebResource resource) {
return resource.accept(MediaType.TEXT_XML).get(Document.class);
}