Fork me on GitHub
#off-topic
<
2021-09-15
>
Stuart10:09:20

I have this github repo, I'm trying to work with the github rest API. Anyone know how to get the tags on the right for a repo? IN this case "agent" "proxy" "rabbitmq"

Stuart11:09:15

I think I need to get the blob, but to get the blob I need the blobs sha. I have no what blob or what sha I need.

p-himik11:09:18

No need for blobs. Those things on the right are not tags. Tags are a Git concept, has nothing to do with those. If you hover over those links, the URL will include /topics/, so you can safely assume those are called topics. Now, you can easily find it in the REST API docs: https://docs.github.com/en/rest/reference/repos#get-all-repository-topics

Stuart11:09:28

Fantastic! Thank you!

👍 2
souenzzo14:09:38

Clojure don't of today:

🤯 20
😕 2
😖 4
bananadance 2
ericdallo14:09:56

Does it work with -> and ->> , not only as-> ?

ericdallo14:09:48

Oh, got it how this works now, yeah, it will just work on as-> I think

✔️ 2
Ben Sless14:09:01

Does Clojure need a "Wat" talk?

😁 6
borkdude14:09:09

perhaps as-> needs a core.spec which just throws ;)

😄 10
emccue16:09:36

lets all agree to just never mention this again

😄 4
seancorfield16:09:01

Ouch! That took me a good few seconds in the REPL to realize why it even works!

seancorfield16:09:53

dev=> (as-> {:a {:b 42}} {:keys [a b]} [a b])
[{:b 42} nil]
dev=> (as-> {:a {:b 42}} {:keys [a b]} a)
{:b 42}
dev=> (as-> {:a {:b 42}} {:keys [a b]} b)
nil
long pause, staring at the results, then 💡

8
👀 2
greg16:09:02

dev=> (as-> {:a {:b 42}} {:keys [a b c]}
            (assoc a :c 45)
            c)
45
Heck of a hack 🤯

4
dominicm20:09:16

@U2J4FRT2T If I find this in any codebase over the next 5 years I'm holding you personally responsible. I still have nightmares about this:

(defmethod humanize :foo [k {k v}] (str v))
Why type :foo when you can just type k!

dominicm20:09:30

(not that you are responsible for that, but someone is!)

dominicm20:09:09

user=> (p/with-pprint-dispatch p/code-dispatch (p/pprint (macroexpand-1 '(as-> {:a {:b 42}} {:keys [a b]} a b))))
(clojure.core/let [{:keys [a b]} {:a {:b 42}} {:keys [a b]} a] b)
nil
This is evil