lein-undertow-adapter

2013-08-18 Thread Alexander Solovyov
I was looking at techempower benchmarks [1] and noticed that fastest (by their measurements) Java HTTP server - Undertow - had no Ring adapter. I felt like it and wrote one just for fun: https://github.com/piranha/ring-undertow-adapter Installation and usage is pretty standard, put [ring-und

Re: querying a clojure data structure

2013-07-25 Thread Alexander Solovyov
On Wed, Jul 24, 2013 at 3:16 PM, Phillip Lord wrote: > What I'd really want to be able to do is to use some sort of query; so I'd > write a data structure like so: > > {:annotation > #{(label ? "it")}} > Some time ago I wrote a little library to act as a model layer for browser apps: https://gi

Re: Can't figure out how to merge this dern map.

2013-07-08 Thread Alexander Solovyov
Actually, drop filter - just (apply merge sequ) is enough. On Mon, Jul 8, 2013 at 6:16 PM, Alexander Solovyov wrote: > The simplest way I see is > > (apply merge (filter identity '({:apple "red and crunchy"} nil nil {:Numb > 1} nil nil {:Field "FRUIT.Description

Re: Can't figure out how to merge this dern map.

2013-07-08 Thread Alexander Solovyov
The simplest way I see is (apply merge (filter identity '({:apple "red and crunchy"} nil nil {:Numb 1} nil nil {:Field "FRUIT.Description"}))) results in {:Field "FRUIT.Description", :Numb 1, :apple "red and crunchy"} On Mon, Jul 8, 2013 at 6:01 PM, VaedaStrike wrote: > So I have data struct

Re: Ring's session cookie-store

2013-07-06 Thread Alexander Solovyov
On Sat, Jul 6, 2013 at 10:07 PM, Thomas Heller wrote: > Hey, > > cookie-store does not expect a string but a map like (cookie-store {:key > your-key}) otherwise it will generate a random new key each restart, which > you observed. > > You can also set some options for the cookie itself, see :cook

Ring's session cookie-store

2013-07-06 Thread Alexander Solovyov
Hi all, I wrote a small site using compojure and friend and naturally I used ring's own wrap-session to handle sessions. My code looks like this: (def app (-> app-routes (friend/authenticate {:credential-fn (partial creds/bcrypt-credential-fn

ClojureScript atom behavior

2013-02-15 Thread Alexander Solovyov
Hi, I use atoms as a data storage in my application right now and add-watch to propagate data changes to DOM. And right now I noticed strange behavior - sometimes new-state is different from dereferenced atom (coming as a parameter to a function right now). And it's not just different, it is diff

[ANN] mesto, a memory storage for ClojureScript

2012-12-19 Thread Alexander Solovyov
mesto is a MEmory STOrage for ClojureScript, I wrote it because of my experience writing JS apps using Backbone.js. http://github.com/piranha/mesto Idea is that you have atom (or atoms), containing all information you need to show to user. Storing this information directly in DOM is not a nice op

Re: Clojure syntax coloring for wordpress blogs

2012-12-15 Thread Alexander Solovyov
On Sat, Dec 15, 2012 at 11:02 PM, Nick Gonzalez wrote: > Does anyone have a good method for syntax coloring clojure code snippets > for a wordpress blog? I've recently started my new blog, and I'm posting > clojure snippets, and would like for them to be syntax highlighted and > indented properly

Re: Clojure contrib datalog

2012-12-10 Thread Alexander Solovyov
Hi, I don't think it's maintained somewhere (at least I haven't seen anything), but at some point in past I extracted it from sources of clojure-contrib and put it on github (with few updates to code, nothing major): https://github.com/piranha/datalog On Sun, Dec 9, 2012 at 1:15 PM, Shantanu Ku

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Alexander Solovyov
On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ wrote: > seems to be working here: https://himera.herokuapp.com/index.html > > cljs.user> (try (+ 1 2) (catch js/Error e e)) > 3 > cljs.user> (try (throw (js/Error. "err1")) (catch js/Error e e)) > # This is not working: (try (throw "err1") (catch js/Erro

Re: ClojureScript & protocols

2012-08-08 Thread Alexander Solovyov
On Wed, Aug 8, 2012 at 4:47 AM, David Nolen wrote: >> Ok, I figured out (well, not I, but m0smith from #clojure): protocols >> should be imported using :require :as, rather than :use :only. > > This seems like a bug to me. Sure, it does look as one to me as well. Should I do something about it? C

Re: ClojureScript & protocols

2012-08-07 Thread Alexander Solovyov
On Mon, Aug 6, 2012 at 10:44 AM, Alexander Solovyov wrote: > I have a simple protocol Map here: > https://github.com/piranha/cj-locations/blob/master/src/map.cljs > > And an implementation of it here (I tried with extend-type as well): > https://github.com/piranha/cj-locations/

ClojureScript & protocols

2012-08-06 Thread Alexander Solovyov
Hi all, I'm trying to get simple ClojureScript application to work. I have a simple protocol Map here: https://github.com/piranha/cj-locations/blob/master/src/map.cljs And an implementation of it here (I tried with extend-type as well): https://github.com/piranha/cj-locations/blob/master/src/goo