Skip to content

Instantly share code, notes, and snippets.

View aengelberg's full-sized avatar
🕶️

Alex Engelberg aengelberg

🕶️
View GitHub Profile
(ns testo.repl
(:use [clojure.pprint])
(:require [instaparse.core :as insta]))
(def grammar "PHPDOC = '/**' {S|tag} '*/'
S = <'*'> #'.+'
tag = <{'*'} '@'> #'\\w*' params
params = #'.*'")
@aengelberg
aengelberg / dump-1460966398821.cljs
Created April 18, 2016 07:59
ClojureScript REPL dump
cljs.user=> (defn stack-size [] (try (inc (stack-size)) (catch :default e 0)))
#'cljs.user/stack-size
cljs.user=> (stack-size)
27835
(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
powerful."
[& path]
(fixed-pathed-path [late path]
(select* [this structure next-fn]
(next-fn (compiled-select late structure)))
(transform* [this structure next-fn]
(ns onyx.metrics.riemann-playground)
(require '[riemann.client :as r])
(def c (r/tcp-client {:host "192.168.99.100" :port 35002}))
(defn intensive-computation []
(let [prom (r/send-events c (repeat 100000 {:status "ok"}))]
(println "Obtained promise")
(println (time (deref prom)))))
@aengelberg
aengelberg / keybase.md
Created November 9, 2016 21:51
keybase

Keybase proof

I hereby claim:

  • I am aengelberg on github.
  • I am aengelberg (https://keybase.io/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:

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