Skip to content

Instantly share code, notes, and snippets.

View onetom's full-sized avatar

Tamas Herman onetom

View GitHub Profile
@onetom
onetom / gist:6ee78d00dfdfef7602cf
Created February 13, 2016 19:36
Adzerk Boot Docker container install from scratch
$ time docker run -it adzerk/boot-clj repl
Unable to find image 'adzerk/boot-clj:latest' locally
latest: Pulling from adzerk/boot-clj
5e7f975cbeeb: Pull complete
a3ed95caeb02: Pull complete
a3e4bb9953ce: Pull complete
32e8c9a8996e: Pull complete
Digest: sha256:713f49c833be372227089aed8dbd424e191f18ada924cfad984258c7c463ce6c
Status: Downloaded newer image for adzerk/boot-clj:latest
@onetom
onetom / build.boot
Created November 18, 2015 00:43
Loading datomic.api from boot-test is slow
(set-env!
:source-paths #{"."}
:dependencies '[
[com.datomic/datomic-pro "0.9.5153"]
[adzerk/boot-test "1.0.4"]])
(require
'[adzerk.boot-test :refer :all])
@onetom
onetom / gist:43e4009dd8fa124ce399
Created June 5, 2015 01:59
Function within `cell-let` fails with Hoplon6
(defelem cell-let-problem [{:keys [data]}]
(cell-let [{:keys [title]} data
fun #(str title " - " title)
double-title (fun)]
(div :text double-title)))
(cell-let-problem :data (cell {:title "cell-let test"}))
# Uncaught TypeError: fun.call is not a function
@onetom
onetom / gist:b6128ef804036d8542cc
Created January 23, 2015 00:19
Side effecting on cell value transition
(defc user nil)
(defc route "")
(defn role-of [user route]
(when user
(if (= "#/secret-route" route) :power-user :pawn)))
(defn get-submissions-for [user route]
(when-let [role (role-of user route)]
(get-submissions role (:email user))))
@onetom
onetom / gist:5815308
Created June 19, 2013 15:38
darcs-push-to-hub.darcs.net-fails
---==| ~/p/darcs-push-to-hub.darcs.net-fails |==---
$ ~/.cabal/bin/darcs push [email protected]:test-before-sending-to-simon
HINT: if you want to change the default remote repository to
[email protected]:test-before-sending-to-simon,
quit now and issue the same command with the --set-default flag.
Sun Jun 16 03:38:54 HKT 2013 Tamas Herman <[email protected]>
* Base sinatra app
Shall I push this patch? (1/20) [ynW...], or ? for more options: a
Apply failed!
@onetom
onetom / map-each
Created April 20, 2011 17:43
Error has been reported already and fixed in R2/Forward, but it hasn't made it into R2 yet
map-each: func [
"Evaluates a block for each value(s) in a series and returns them as a block."
[throw catch]
'word [word! block!] "Word or block of words to set each time (local)"
data [block!] "The series to traverse"
body [block!] "Block to evaluate each time"
/into "Collect into a given series, rather than a new block"
output [any-block! any-string!] "The series to output to" ; Not image!
/local init len x
][