Fork me on GitHub
#clojure-uk
<
2018-06-01
>
3Jane07:06:49

(TGIF and also happy children’s day)

yogidevbear07:06:46

\o -( Morning )

😄 4
👋 4
thomas08:06:29

mogge 😼

guy09:06:26

morning!

korny09:06:21

Anyone got any favourite really simple command-line libraries? I’ve used tools.cli a fair bit, and it’s nice for real apps, but I’d love something simple for scripts I’m throwing together.

korny09:06:29

My use case is, I’m trying to use deps.edn to replace all the little bits of glue I use, most often in ruby or bash, with clojure. If I can.

korny09:06:16

So I don’t want full user-friendliness, validation, multiple options and the like. Just some simple boilerplate to let me pass parameters with less pain than parsing arguments myself.

korny09:06:44

I can cut-and-paste the bits I need from tools.cli but it always seems to have a bit much complexity for what I want.

korny09:06:18

@sundarj yeah - that’s exactly the sort of thing…

korny10:06:10

I did find that I could probably do both simple scripts, and cli parsing, with boot rather than deps.edn: https://github.com/boot-clj/boot/wiki/Scripts

korny10:06:19

… but I suspect that I’m bikeshedding on this. Probably better to get everything working with my ruby scripts, than optimistically move them all to clojure. Especially as I keep meeting things (like graphql clients) that are far better supplied by the ruby ecosystem than the clojure one, at the moment.

👆 4
👍 4
danm10:06:06

Yeah, saw your question on #clojure. Was going to say about lacinia, then I realised you were asking about a client, not a server

korny10:06:40

If I wanted to do real bikeshedding, I’d write a client 🙂 It’s mostly just JSON/HTTP queries, plus it’d be great to have a client with smart error handling and some pagination support.

rickmoynihan16:06:58

Is there a generic way for a client to support pagination? As far as I knew pagination was a pattern that you had to apply bespoke into each schema… i.e. there’s no generic shareable machine understanding of what pagination looks like. Hoping you can tell me this is fixed 🙂

korny17:06:43

Hmm - I only really know the github api, so I don't really know how other people do pagination...

danm10:06:47

@korny Just seen your comments on #cursive. How do you use deps.edn with boot/lein (we're using boot)? Does it just replace the need to have (set-env! :dependencies) within build.boot?

seancorfield14:06:26

I'm the author/maintainer of https://github.com/seancorfield/boot-tools-deps -- is that the sort of thing you're asking about?

danm17:06:43

Cool, I will have a looksee :) Ta!

korny10:06:09

@carr0t I’m just trying to use it for small standalone scripts - not integrating with boot/lein at all (though I gather there are plugins to do that)

korny10:06:28

Mostly, I have a tool I’ve written using lein, which queries git and spits out data as JSON - I want to post-process that JSON, linking it up with some GraphQL data (from github), and rather than spin up a whole new leiningen project for this rather-hacky post-processing, or add a new endpoint to my app, I thought I could just code it as a single clojure script via command-line clj

thomas13:06:49

does anyone here care about the cricket?

thomas13:06:59

:cricket_bat_and_ball:

👀 4
3Jane13:06:36

They used to have good cricket-meal brownies in Wahaca, but alas, no more…

🦗 4
korny13:06:48

Yeah - I had some crickets at Wahaca, they were were yummy.

korny13:06:38

I only care if Australia are trouncing England, so I can 😛 at my UK friends. Or if England are trouncing Australia, so I can 😛 at my cricket-mad Australian brother-in-law.

😂 16
8
thomas14:06:23

I guess the answer is no... never mind.

korny15:06:10

Sigh. Lessons learned today: - The git API is a hairy beast - The github v4 API is also pretty hairy - Everyone uses git/github differently

dominicm15:06:52

You mean jgit?

korny15:06:10

Sorry, yeah, jgit. But a lot of the pain is the underlying git model.

korny15:06:07

(and my simplistic assumptions - at the recent client, tags were all on master not branches, and releases were clearly tagged. It seems most of the big projects I’ve been looking at use release branches or some other forest-of-branches approach, and tag releases in unclear/inconsistent ways)

korny15:06:19

sigh. Hindsight is of course perfect.

korny15:06:41

Anyway, this was just a random rant, nothing much to do with clojure, please pay no attention and go about your business.

dominicm15:06:00

tags vs branches for releases is a point of contention

dominicm15:06:03

Linux uses trees, mostly

dominicm15:06:12

Different things suit different problem statements.

korny15:06:06

and git lets you do magic strange things, so of course people do magic strange things 🙂

korny15:06:22

Like, I didn’t even know you could make a commit with 3 parents, until I found one: https://github.com/spring-projects/spring-framework/commit/2deeb54a9b6974b5da03c519d596891393b954df

korny15:06:02

(again, in hindsight of course you can, but this is the first one I’ve ever seen)

dominicm15:06:41

yeah, octopus commits or something

seancorfield15:06:48

TIL! Guess I'll have to go learn how to do that 😄

👿 4
trollface 4
dominicm16:06:13

I read about it when reading about the context of linux kernel. It's how they manage patches from multiple upstreams simultaneously.

yogidevbear17:06:34

(interlude ❤️)

korny21:06:16

Whee… some people make release tags that aren’t on a branch at all thisisfine

😅 4
korny21:06:57

Oh well. I’ve done the most critical task I needed to do - download all the custom emoji from my client’s slack instance before they delete my account 🙂

alexlynham10:06:08

Is there an automated way of doing that?

korny10:06:12

There are some chrome extensions, but I wasn't sure I trusted them. The option I used was this script to run in the chrome console : https://gist.github.com/dogeared/f8af0c03d96f75c8215731a29faf172c

alexlynham10:06:09

breaking up with a company is one thing

alexlynham10:06:17

but breaking up with their custom emojis is hard

korny12:06:26

GDS had a lot - I had to fiddle that script as they didn’t all fit on one page. Some pretty topical too… gdpr

korny21:06:28

I just couldn’t cope without try-not-to-cry

😂 4