This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-22
Channels
- # beginners (42)
- # boot (73)
- # cider (17)
- # clara (1)
- # cljs-dev (47)
- # cljsrn (9)
- # clojars (4)
- # clojure (241)
- # clojure-italy (11)
- # clojure-norway (5)
- # clojure-russia (93)
- # clojure-spec (28)
- # clojure-uk (32)
- # clojurescript (170)
- # core-async (20)
- # cursive (62)
- # data-science (2)
- # datomic (47)
- # dirac (4)
- # events (1)
- # funcool (12)
- # gsoc (1)
- # hoplon (59)
- # immutant (8)
- # lambdaisland (4)
- # luminus (3)
- # lumo (11)
- # off-topic (13)
- # om (81)
- # onyx (1)
- # pedestal (47)
- # planck (30)
- # re-frame (2)
- # reactive (1)
- # reagent (2)
- # ring-swagger (15)
- # rum (1)
- # slack-help (5)
- # specter (5)
- # testing (5)
- # uncomplicate (8)
- # untangled (16)
- # vim (71)
- # yada (16)
yeah because its like "us flag" changes to "at flag" and more then 50 cards like this (its a search result)
currently i have this ugly thing here:
(defn country-flag [class]
(with-let [elem (i)] (with-init! (.addClass (.removeClass (js/$ elem)) class))))
@peterromfeld you can remove classes
https://github.com/hoplon/hoplon/wiki/HTML-attributes-and-JS-events-%28on%21%2C-do%21%29
"Providing a map of classes as keywords with true or false is more verbose but allows us to enforce the existence or absence of a class. "
@peterromfeld additionally, this might be a use case for a data attribute
:data-country-flag current-flag
@thedavidmeister we are using semantic-ui, not sure how i would use it with data attribute
@peterromfeld then set the classes as keys of a map and true/false in the values
e.g. :class (j/cell {:us-flag true :at-flag false})
for all 250 countries in each of the 50 cards?
@peterromfeld yeah... the problem with class is that it's kind of "global"
you could do something with a watch maybe
like, stick false
into everything in the old value
to clarify, i dont propose to change :class
its how i use it most of the time.. just in this exception it would be nice to have :class!
which acts little different
you could do something with lenses or a do-watch
(let [add (j/cell nil)
remove (j/cell nil)
(j/cell=
{add true remove false}
#(j/dosync
(reset! remove @add)
(reset! add %))))
something like that
generally though i really use data attributes for anything like this
i prefer having k/v data that i can control on a per-k basis than a big bucket o' vals
btw i just put my new method into index.cljs.hl and use :class!
for this flag exception (dont want to reinvent something that my css framework provides)
works like a charm
cool, well you can also wrap the above in a defn and get cells for each card
(defn flag-class-cell
(let [n (j/cell nil)
o (j/cell nil)]
(j/cell=
{n true o false}
#(j/dosync
(reset! o <@U3MG3NJCC>)
(reset! n %)))))
Has there been an update to https://github.com/tailrecursion/hoplon-deploy-heroku for the new boot?
I commented out a couple of things that were obvious problems, hoping it'd work, and then got, "Wrong number of args (1) passed to: cli/argspec->cli-argspec". I'm sure this is just one more thing I need to learn at a deeper level, but I don't know what I'm doing here.
Retrieving maven-metadata.xml from http://repo1.maven.org/maven2/ (4k) Retrieving maven-metadata.xml from https://repo1.maven.org/maven2/ (4k) Retrieving maven-metadata.xml from https://repo.clojars.org/ (1k) Classpath conflict: org.clojure/clojure version 1.7.0 already loaded, NOT loading version 1.5.1 Boot.main Boot.java: 258 ... boot.App.main App.java: 491 boot.App.runBoot App.java: 399 org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 150 org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 159 ... boot.main/-main main.clj: 206 boot.main/-main/fn main.clj: 206 ... clojure.lang.ArityException: Wrong number of args (1) passed to: cli/argspec->cli-argspec clojure.lang.ExceptionInfo: Wrong number of args (1) passed to: cli/argspec->cli-argspec file: "/var/folders/mg/b82_3kcn7bl97_3rfl4klmlw0000gn/T/boot.user5190031215929737070.clj" line: 9
that was from the last run... previous errors include java.lang.RuntimeException: No reader function for tag tailrecursion.boot.core/version java.lang.RuntimeException: Unable to resolve symbol: add-sync! in this context clojure.lang.ExceptionInfo: Unable to resolve symbol: add-sync! in this context
the java.lang.RuntimeException: No reader function for tag tailrecursion.boot.core/version
error
Yes, that was what I was asking. Is there a version for the new boot, by chance?
#!/usr/bin/env boot ;#tailrecursion.boot.core/version "2.5.1" (set-env! :dependencies '[ ;tailrecursion.boot.core/version "2.5.1" [tailrecursion/hoplon "5.10.23"] [tailrecursion/boot.task "2.2.4"] [tailrecursion/boot.notify "2.0.2"] [tailrecursion/boot.ring "0.2.1"]] :src-paths #{"src"} :out-path "resources/public" :main-class 'hello-world.core) ;; Static resources synced to output dir ;(add-sync! (get-env :out-path) #{"resources/assets"}) (require '[tailrecursion.hoplon.boot :refer :all] '[tailrecursion.boot.task.notify :refer [hear]] '[tailrecursion.castra.task :refer [castra-dev-server]]) (deftask heroku "Prepare project.clj and Procfile for Heroku deployment." [& [main-class]] (let [jar-name "hoplon-app-standalone.jar" jar-path (format "target/%s" jar-name) main-class (or main-class (get-env :main-class))] (assert main-class "missing :main-class entry in env") (set-env! :src-paths #{"resources"} :lein {:min-lein-version "2.0.0" :uberjar-name jar-name}) (comp (lein-generate) (with-pre-wrap (println "Writing project.clj...") (-> "project.clj" slurp (.replaceAll "(:min-lein-version)\\s+(\"[0-9.]+\")" "$1 $2") ((partial spit "project.clj"))) (println "Writing Procfile...") (-> "web: java $JVM_OPTS -cp %s clojure.main -m %s $PORT" (format jar-path main-class) ((partial spit "Procfile"))))))) (deftask development "Start local dev server." [] (comp (castra-dev-server 'hello-world.api) (watch) (hear) (hoplon {:prerender false}))) (deftask production "Compile application with Google Closure advanced optimizations." [] (hoplon {:optimizations :advanced}))
oh, ok, don't use slack much...
um, I'm seeing a + by direct messages?
give me a second, I'll get there 🙂
oh, ok, feeling dumb
(deftask heroku
"Prepare project.clj and Procfile for Heroku deployment."
[& [main-class]]
(deftask heroku
"Prepare project.clj and Procfile for Heroku deployment."
[m main-class NAME str "The name of the main class."]
ok, let me try that. Sorry for being so slow. I use clj for gaming math and systemy things lose me quick.
@john_tollison I recently updated hoplon-castra template and am aware of people using on heroku
(different method, jar based deploy, but can help you out if needed)
Yes, I found my way to that update. That was exactly what I was asking for initial. Thanks 🙂
*initially