This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-30
Channels
- # admin-announcements (3)
- # arachne (8)
- # beginners (5)
- # boot (52)
- # braveandtrue (4)
- # cider (17)
- # cljsrn (1)
- # clojure (36)
- # clojure-dusseldorf (2)
- # clojure-india (1)
- # clojure-russia (30)
- # clojure-uk (1)
- # clojurebridge (1)
- # clojurescript (47)
- # clojutre (1)
- # component (1)
- # core-async (3)
- # cursive (5)
- # datascript (1)
- # datomic (4)
- # emacs (1)
- # error-message-catalog (62)
- # garden (3)
- # hoplon (16)
- # jobs (5)
- # luminus (11)
- # mount (1)
- # om (32)
- # onyx (17)
- # spacemacs (4)
- # untangled (20)
- # yada (4)
Hi! I'd like to encode nested-map to url params
{:amount "2000"
:metadata {:order-id "132ad31"
:s-tracking "93814938"}}
"amount=2000&metadata[order_id]=132ad31&metadata[s_tracking]=93814938"
Is there something out-of-the-box I can use?
apparently [ring.util.codec :refer [form-encode]]
can't do exactly this...
Thanks!
Ok, this does the trick...
(defn create-charge [body]
(client/post ""
{:query-params body
:headers {:Authorization (str "Bearer " sk-token)}
:as :x-www-form-urlencoded
:accept :json
:throw-exceptions false
}))
compojure, I beliebe
believe*
tom: ^
@tom yada is also great for apis - https://github.com/juxt/yada
I'm currently using midje, and my tests usually end up as shown in the example below:
(fact "default value is returned for empty sequences" (first-element [] :default) => :default (first-element '() :default) => :default (first-element nil :default) => :default (first-element (filter even? [1 3 5]) :default) => :default))
Generally, I'm testing inside a fact, the same function. I wish I could dry up this and instead just specify the arguments => output.
I get an error message when I type in (get-messages) in the repl
IllegalArgumentException db-spec mount.core.DerefableState@c1b586e is missing a required parameter clojure.java.jdbc/get-connection (jdbc.clj:292).
`
https://github.com/6ewis/guestbook/blob/master/resources/sql/queries.sql@lewix: you need to reference the database namespace. Read through: http://clojurians-log.mantike.pro/luminus/2016-03-11.html
Something like (use 'guestbook.db.core)
@seancorfield: Thanks for the examples, but that's not quite the issue I'm having. My problem is that my CSS/JS files are not being found. I've written them the same way you have, but mine are not loaded, though they are in the classpath. In Python and Django, I remember setting up a staticfiles variable that specified the location of these files. Is there something similar for Selmer, or another reason perhaps it can't find my files?
@nkraft: that doesn't sound like a Selmer issue since that just transforms HTML. It's about how your http server is running and what the URLs to those files would be.
@nkraft: are you using Ring middleware to serve up resources, for example?
Does anyone know if there's any published data or surveys of who is using clojure, by location and by industry?
@devn Thanks. I just read the 2015 one. Not exactly by industry, as it lumped all web development together, but it was helpful nonetheless
@kevinmershon: regional usage can be understood through looking at active meetup groups to some extent, I imagine
Yeah, I agree