Fork me on GitHub
#beginners
<
2016-10-12
>
Drew Verlee03:10:42

(ns res.core
  (:gen-class)
  (:require [aero.core :refer [read-config]]
            [ :as io]
            [clojure.tools.cli :refer [parse-opts]]
            [lib-onyx.peer :as peer]
            [onyx.job]
            [onyx.api]
            [onyx.test-helper]
            ;; Load plugin classes on peer start
            [onyx.plugin [core-async]]
            ;; Load our tasks
            [res.tasks [math]]
            ;; Load our jobs
            [ [heating-and-cooling]]))
what would be the proper way to have http://res.jobs reference two jobs?
➜  res git:(heating-and-cooling) ✗ tree src
src
└── res
    ├── core.clj
    ├── jobs
    │   ├── basic.clj
    │   └── heating_and_cooling.clj
    └── tasks
        └── math.clj
I tried : :refer [basic heating-and-cooling] but i got an error about res init. not sure what i should read about. Probably require and refer

jeremykirkham10:10:01

Hi guys, I'm saving some edn files to AWS S3, but when I try to download and open them my mac thinks they're Adobe DRM Activation Key files, how do I save it as a plain edn file?

singen10:10:13

@jeremykirkham On your Mac, right click the edn file and select Get info. Then look at the part “Open with”.

singen10:10:09

You can then select another application to open all edn files with, or just that one

jeremykirkham10:10:53

@singen thanks for that 🙂

singen10:10:54

Pay it forward 🙂

samueldev15:10:33

are there any channels in this slack where discussing broader clojure career-related things would be appropriate?

sveri15:10:06

@samueldev maybe #jobs-discuss ?

piyush18:10:51

Hi I have a simple question on Aero not sure if anyone can help here but I will try

piyush18:10:01

I am trying to read the Port in from the environment.

piyush18:10:15

My config.edn is:

piyush18:10:17

{ :cookie-name "good-cookie" :env-type #profile {:dev :dev :test :test :prod :prod} :yada {:port (int #or [#env PORT 3000])} ;; :yada {:port 4500} }

piyush18:10:38

I need the PORT to be converted to an Int

piyush18:10:45

or Integer

piyush18:10:12

{:cookie-name "good-cookie", :env-type nil, :yada {:port (int "4000")}}

piyush18:10:28

this is what I get from using aero/read-config

val_waeselynck19:10:45

@piyush (Integer/parseInt port-str)

piyush20:10:54

Thanks that does work but I may be misunderstanding how the evaluation is happening. Aero has a function read-config and it doesn’t seem to evaluate the parseInt

piyush20:10:11

So here is my config.edn file

piyush20:10:12

{ :cookie-name "good-cookie" :env-type #profile {:dev :dev :test :test :prod :prod} :yada {:port (Integer/parseInt #or [#env PORT 3000])} }

piyush20:10:31

(def cfg (ac/read-config "src/main/resources/config.edn"))

piyush20:10:48

{:cookie-name "good-cookie", :env-type nil, :yada {:port (Integer/parseInt "4000")}}

piyush20:10:49

(Integer/parseInt "4000”)

piyush20:10:58

Thats what I want to evaluate

piyush20:10:37

So I get this back: {:cookie-name "good-cookie", :env-type nil, :yada {:port 4000}}

piyush20:10:45

but its not working

piyush20:10:03

I get {:cookie-name "good-cookie", :env-type nil, :yada {:port (Integer/parseInt "4000")}}

seancorfield22:10:29

(caveat: I had never heard of Aero before -- so I don't know anything beyond what I just read there)

seancorfield22:10:11

It looks like a nice library. I'd been looking at Outpace/config before. That also uses tagged literals for stuff.

piyush23:10:10

Thanks was trying that but was on old version, upgrading to aero [1.0.1] fixed it.