Skip to content

Instantly share code, notes, and snippets.

View maacl's full-sized avatar

Martin Clausen maacl

View GitHub Profile
@maacl
maacl / gist:1141943
Created August 12, 2011 12:32
Silly Chat errors
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
Timestamp: Fri, 12 Aug 2011 12:45:11 UTC
Message: 'undefined' is null or not an object
Line: 643
Char: 2
Code: 0
@maacl
maacl / core.clj
Created August 25, 2011 20:57
ringerfinger
(ns rf-test.core
(:use (ringfinger core resource fields db auth auth-routes), ringfinger.db.inmem,
ringfinger.timesavers.hooks,
ring.util.serve))
(make-user inmem :ringfinger_auth {:username "test"} "demo" "salt")
(defresource contacts
{:db inmem
:pk :name_slug
@maacl
maacl / gist:1654089
Created January 21, 2012 21:27
AST Paths
[
Object
id: "invoice_no"
path: Array[4]
0: "statements"
1: "1"
2: "id"
3: "original"
length: 4
__proto__: Array[0]
@maacl
maacl / gist:2399054
Created April 16, 2012 14:09
Nathan University Lesson 2.2
var reverse = function(expr) {
var make_node = function(t, left, right) {
return {tag: t,
left: left,
right: right};
};
if (expr.tag == 'note') {
return expr;
}
return make_node(expr.tag,
;;framework.clj
;;...
(definterface ES
(putIfAbsent [k v])
(rep [k old-val new-val])
(get [k]))
(defn ^ES jes []
(let [m (atom {})]
(reify ES
public static Document getXml (WebResource resource) {
return resource.accept(MediaType.TEXT_XML).get(Document.class);
}

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:

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)
(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"]
@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