Skip to content

Instantly share code, notes, and snippets.


Alex Engelberg aengelberg

View GitHub Profile
aengelberg / csbnf.clj
Last active Sep 1, 2018
*slaps roof of parser*
View csbnf.clj
(ns alex.csbnf
"Framework for writing parsers using CSBNF (Car Salesman Backus-Naur Form) notation."
[instaparse.combinators :as c]
[instaparse.core :as insta]))
(def csbnf-parser
"grammar = rule+
aengelberg / core.clj
Created Feb 3, 2017
Manifold examples
View core.clj
(ns hello-manifold.core
[aleph.http :as http]
[byte-streams :as bs]
[cheshire.core :as json]
[clojure.string :as str]
[manifold.deferred :as d]
[manifold.executor :as e]
[ :as s]))

Keybase proof

I hereby claim:

  • I am aengelberg on github.
  • I am aengelberg ( on keybase.
  • I have a public key whose fingerprint is 9DEF 235B 2861 1B62 19A2 0D0B 87C7 F770 9E33 DB7A

To claim this, I am signing this object:

View riemann_playground.clj
(ns onyx.metrics.riemann-playground)
(require '[riemann.client :as r])
(def c (r/tcp-client {:host "" :port 35002}))
(defn intensive-computation []
(let [prom (r/send-events c (repeat 100000 {:status "ok"}))]
(println "Obtained promise")
(println (time (deref prom)))))
View specter_select_view.clj
(defn select-view
"Navigates to a sequence that is the result of a select on the
current structure. Has similar functionality of srange and filterer,
but can be used with arbitrary selectors making it vastly more
[& path]
(fixed-pathed-path [late path]
(select* [this structure next-fn]
(next-fn (compiled-select late structure)))
(transform* [this structure next-fn]
View dump-1460966398821.cljs
cljs.user=> (defn stack-size [] (try (inc (stack-size)) (catch :default e 0)))
cljs.user=> (stack-size)
View instaparse-phpdocs.clj
(ns testo.repl
(:use [clojure.pprint])
(:require [instaparse.core :as insta]))
(def grammar "PHPDOC = '/**' {S|tag} '*/'
S = <'*'> #'.+'
tag = <{'*'} '@'> #'\\w*' params
params = #'.*'")