Fork me on GitHub
#beginners
<
2018-01-28
>
eboats00:01:57

hello, i'm on windows and would like to use leiningen with git bash. i downloaded the lein.sh, put it in my /bin dir and ran lein ok and it downloaded the standalone jar. however, when i try to run lein repl, i get pkix exceptions when it tries to download clojure-complete from clojars. I'm at work behind a company proxy and set http_proxy var but still no luck. Is there anyway to get around this error, maybe put a cert in my java keystore or something?

seancorfield02:01:06

@eboats You might try the #leiningen channel to see if the Leiningen experts know -- but I don't think many people have even tried to run the nix version of Leiningen on Git Bash...

seancorfield02:01:27

I'm on Windows 10 and use Ubuntu via WSL for all my command line dev work...

dpar04:01:21

how can I have different behaviour based on wether I launched the application with "lein run" or from the compiled jar?

schmee09:01:12

different Leiningen profiles, AOT compilation, different entry points… lots of things that can change 🙂

dpar09:01:32

@schmee ok, but how can I know it in the code?

dpar10:01:05

how do I serialize a java-time object into edn?

dpar11:01:48

more generically, how can I make pr-str create a custom tag when it meets a java-time object

greglook22:01:57

@teikfaiv you’d need to extend print-method for that object; a simple example would be:

(defmethod print-method MyObject
  [x writer]
  (print-method (tagged-literal 'my/tag (my-render-fn x)) writer))

greglook22:01:17

Alternately, check out https://github.com/greglook/puget for a more customizable printer that doesn’t use global multimethods.

dpar11:01:24

because it seems that there is no standard to serialize for example a local-time

Aron12:01:31

learning clojure is like the worst nightmare at a devops job. obscure exception after obscure exception. outside of java i don't remember having to deal with this many different exceptions.

noisesmith13:01:19

@teikfaiv you can look up values via weavejester/environ, and then set specific values in project.clj - when using uberjar nothing from project.clj has any effect, so it will go back to defaults

dpar13:01:56

very nice, thanks @noisesmith

noisesmith13:01:51

or, when running the uberjar you can override the defaults using java system properties or environment variables

gklijs13:01:35

@vincent.cantin depends an the project. For example for a small pet project, where the only communication will be by the client and server in the same project I use a websocket, with some custom ‘protocol’, to handle communication. But if you have more options to connect to the server, maybe even outside of the organisation, graphql, or rest, might make more sense.

Vincent Cantin14:01:29

thx for the answer. I think I will go for the websockets. Someone pointed me to https://github.com/ptaoussanis/sente which looks good

sb07:01:30

gniazdo is beginner friendly too

max13:01:16

hello, i define a function inside my core.clj file. Then i try to invoke it in cider repl, but there is an error. How i can invoke this func in repl? https://imgur.com/AwphHGP

pfeodrippe14:01:51

Have you loaded the file at the hello.core namespace?

max14:01:36

C-c C-k is undefined

max14:01:48

i dont load this file at the hello.core namespace, i just run cider repl in spacemacs

pfeodrippe14:01:01

I've assumed it was emacs, sorry. How do you load a buffer in spacemacs?

pfeodrippe14:01:51

Maybe using SPC b

max14:01:44

usually to open new buffer i type SPC-b-b and then choice some file

pfeodrippe14:01:01

Have you followed these instructions? https://spin.atomicobject.com/2017/02/16/clojure-development-in-spacemacs/ maybe it could help if your configuration was different

pfeodrippe14:01:51

Check if it says Clojure mode at the bottom of the buffer

max14:01:39

thanks a lot for help and article, it helped me

pfeodrippe14:01:46

Maybe you could go to #spacemacs and see what's missing

pfeodrippe14:01:47

You're welcome o/

greglook22:01:57

@teikfaiv you’d need to extend print-method for that object; a simple example would be:

(defmethod print-method MyObject
  [x writer]
  (print-method (tagged-literal 'my/tag (my-render-fn x)) writer))