Found a good set of screencasts as quick references for functions,
namespaces, collections, destructuring, sequences and conditional flow.
Quick 1 to 2 min screencasts on each:
http://www.pluralsight.com/training/Courses/TableOfContents/clojure-fundamentals-part-one
And the more advanced for
Yes via im4clj - https://github.com/neatonk/im4clj
[im4clj 0.0.1]
The developer recommends shell scripting with Conch with standard command
line syntax, however im4clj works perfectly fine for 2 core needs for photo
gallery apps:
1. resize with proportions, and
2. crop thumbnails from center
Agreed if your img processing use case is minor, prob not worth it.
If there's a lot of member submitted content for example and speed/smaller
file sizes are important, there's value in graphicmagick. Its a simple 1
line command install and thereafter I've never touched it except via code
to
I managed to get Postal delivery working with Mandrill, still use of
templates with formatting v helpful. Mailer and Postal have a slight
problem on recognizing the meta info for smtp auth.
So with some fiddling figured out how to merge Clostache into Postal for
html templates with dynamic
Hi, I'm trying to use Image Resizer and am goofing up on the syntax
somewhere:
(defn update-profile [firstname lastname email file]
(let [member-id (session/get :member-id)
redirecturl (str /member/ member-id)
original-file-path(str (img-path) /
Hi Moritz and Michael, thanks for the pointer in the right direction.
Almost there except for 1 point I think. The whole operation is made of 2
functions, one to upload/resize/save and the other to provide a unique
filename by original filename + timestamp.
(defn add-timestamp [filename]
(let
Hi Moritz and Michael, thanks for the pointer in the right direction.
Almost there except for 1 point I think. The whole operation is made of 2
functions, one to upload/resize/save and the other to provide a unique
filename by original filename + timestamp.
(defn add-timestamp [filename]
(let
I got the file naming fixed with:
(upload-file (img-path) (assoc-in file [:filename] new-file-name))
The last part is reading in the uploaded file so it can be resized with
Image Resizer. I wrote the code as:
(with-open [rdr (clojure.java.io/reader (str (img-path) /
new-file-name))])
As a
I would also recommend Luminus as a user friendly start you can generate a
new project with Selmer for views (Django style), authentication,
migrations and db persistence out the gate with either mysql, postgres,
mongo (or H2 as default if you select neither) and Korma as db dsl.
It will give
Hi, I'm new to clojure and have got a productive handle on CRUD, sessions,
routing, writing functions. Last couple things are email delivery, image
processing (resizing).
So I looked on the clojure-toolbox site for email delivery libs with smtp
authentication for a Mandrill acct fo
Hi Jim, am not opposed to using java and put the code in a diff namespace
to reuse.
Am going to try out a lib for delivery svc, one for Mandrill and the other
for Postmark.
If any glitches there, will use java as you suggested.
Thanks for the working example.
Pardeep.
--
You received this
I'm not inferring it doesn't work at all as obviously over the years some
of these libs have worked for someone. However these libs are not working
for me with Mandrill which has worked seamlessly for email delivery in
other langs. I checked the API logs on Mandrill and it appears in the last
I'm not inferring it doesn't work at all as obviously over the years some
of these libs have worked for someone. However these libs are not working
for me with Mandrill which has worked seamlessly for email delivery in
other langs. I checked the API logs on Mandrill and it appears in the last
I'm not inferring it doesn't work at all as obviously over the years some
of these libs have worked for someone. However these libs are not working
for me with Mandrill which has worked seamlessly for email delivery in
other langs. I checked the API logs on Mandrill and it appears in the last
(parse-int id)
member (memberdb/get-member id)]
On Sunday, February 16, 2014 4:01:03 AM UTC+2, The Dude (Abides) wrote:
Thanks, here's the entire stack trace:
java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to
clojure.lang.IFn
members.clj
Thanks, here's the entire stack trace:
java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to
clojure.lang.IFn
members.clj:33 sikhpyar.routes.members/get-member
members.clj:50 sikhpyar.routes.members/fn
core.clj:94
Hi, I'm writing some queries using java.jdbc 0.3.3 as follows:
(defn get-member-url [id]
(jdbc/query db [SELECT * FROM members WHERE id = ? LIMIT 1 id]))
However this results in an exception error:
java.lang.ClassCastException
clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
Not sure
Hi, I'm getting an error calling a record from an id passed via a url using
Korma Sql. The error says:
org.postgresql.util.PSQLException
ERROR: operator does not exist: smallint = character varying Hint: No
operator matches the given name and argument type(s). You might need to add
explicit
Thanks for the feedback Jarrod, the gallery-path did exist because I was
able to upload files without renaming them and I saw the map with keys per
your tip. I just wasn't familiar enough with the plumbing in noir.io or the
language as I finally had the time to spend a week getting into clojure
Hi, I'm new to clojure and am trying to rename an uploaded file with a
unique identifier such as a long time stamp as follows:
(defn add-timestamp [filename]
(let [ext-position (.lastIndexOf filename .)
timestamp(tc/to-long (time/now))]
(if (pos? ext-position)
(str
Hi Jarrod, I tried changing filename to string as follows
(defn handle-upload [filename]
(upload-file (gallery-path) (add-timestamp (str filename)))
(resp/redirect /upload))
and still got an error as:
java.lang.NullPointerException
My entire file code is:
(ns pgapp.routes.upload
-upload to the above and verify that you are
getting the filename alone in your (let [filename (...)] ...) binding.
Hope that helps.
On Friday, January 24, 2014 11:28:00 PM UTC-5, The Dude (Abides) wrote:
Hi Jarrod, I tried changing filename to string as follows
(defn handle-upload [filename
Hi Jarrod, thanks for your help. I tried that but got a
java.lang.NullPointerException error again.
I tried the code without the add-timestamp and still get the
java.lang.NullPointerException
When I try it as just :filename filename it does in fact show only the file
name.
So not sure why
23 matches
Mail list logo