Fork me on GitHub
#clojure-uk
<
2016-07-11
>
otfrom07:07:20

Hail Ming!

mccraigmccraig08:07:12

@otfrom: the merciless or some other ming ?

otfrom08:07:48

I've showered, so the Merciless

martintrojer08:07:26

just remove that middleware then

thomas08:07:44

my reading of Google is that Ring does that automagically...

martintrojer09:07:12

nothing is automatic in ring

thomas09:07:32

I haven’t got that in my setup… I do have ring-defaults though. could that be it?

mccraigmccraig09:07:29

most likely you pulling in some default middlewares from somewhere @thomas ring-defaults seems a likely culprit

thomas09:07:48

I suspect so… annoying.

korny09:07:24

Quick question folks - is there any built-in function to do simple string templating, a-la erb or similar - just something that understands maps, like (template “hello ${foo.bar}” {:foo {:bar “world”}}) ?

korny09:07:43

There are lots of 3rd party libs for this, but they feel a bit like overkill

glenjamin09:07:08

i tend to rely on format and helper functions, which probably isn’t a very helpful answer

korny09:07:28

Does format let you use named substitutions? I thought they were all positional

glenjamin09:07:44

or a “proper” template language if I want more

korny09:07:28

yeah. Guess I should use a proper one - just trying to avoid project.clj bloat for a tiny bit of code. Hmm, maybe I can convince my config tool to do it...

glenjamin09:07:37

(good) dependencies are great

glenjamin09:07:49

it’s code someone else wrote and tested to solve a defined problem \o/

korny09:07:41

well, if they tested it! 🙂

glenjamin09:07:23

they almost certainly tested it. In many cases not in a reproducible way they checked in 😞

glenjamin09:07:44

There’ll likely be a well tested mustache impl around though

korny09:07:03

Yeah - trouble is, most of the templating libraries add a whole lot of stuff I don’t need, like loops and nesting and callbacks and the like. Great if you are building html - I just want something like es6 string interpolation.

korny09:07:03

anyway, seems on review that I probably don’t need this, which saves me the half an hour digging through clojure-toolbox to work out which templating library is well tested, and simple/easy, and stable… 🙂

korny09:07:31

(I have a long-term “I’ll never really get to it” plan to write a chrome addon, that does simple github project metrics when you hover over a github link - stuff like “are there tests / CI builds”, “how many active issues are there”, “when was it last upated”… - all the stuff I do manually when looking for a good library 🙂 )

glenjamin09:07:54

that would be great

mccraigmccraig10:07:41

@thomas: here you go - https://github.com/ring-clojure/ring-defaults/blob/master/src/ring/middleware/defaults.clj#L91 - copy the rest and get rid of that, or look at the anti-forgery middleware to figure out what you are doing wrong

thomas10:07:19

cool, thank you @mccraigmccraig I’ll give that a try… (in between my “normal” job )

martintrojer10:07:07

jobs, who needs them....

thomas10:07:58

I know… hacking Clojure is way more fun (even if at times like this rather frustrating). but my team lead (see previous discussions here 2 weeks ago) can be very pedantic from time to time.

martintrojer10:07:09

Leadsom dropping out

martintrojer10:07:20

It'll be a coronation of May then

glenjamin10:07:25

@thomas: If you look at the wrap function there, it looks to have a way to disable individual bits

thomas10:07:46

yes I noticed that as well @glenjamin

dominicm10:07:03

@thomas: As a rule, I've found that defaults/site rarely suit my purposes, and it's better to just add them myself. Especially for small projects.

thomas10:07:13

Rumours of Andrea Leadsom quitting send pound jumping to a <cough> three hour high.....

dominicm10:07:39

Then again, I'm a big fan of the no-framework approach to things. So our preferences may vary.

thomas10:07:54

@dominicm: I agree and I’m interested to see how Arachne will work out though

dominicm11:07:04

Yeah, at the least I think we can harvest some good ideas from it. Monolithic projects often have their good ideas pulled into smaller libraries once the abstraction is figured out.

thomas11:07:13

May it is…

korny11:07:59

How come nobody ever polls politicians on their attitude to FP vs OO programming? I don’t even know if May is a fan of immutability. And who writes better macros - Corbyn or Eagle? It’s so hard to know who to like.

mccraigmccraig12:07:09

i'm pretty sure almost all politicians would blanche at the idea that immutability is even a thing @korny

korny12:07:05

Pity. “I’m sorry, when you called (brexit eu :uk) you created a new instance of eu - the current one still contains :uk” 🙂

martintrojer14:07:20

Just listened to May's talk

martintrojer14:07:28

wow, that was the Labour agenda

martintrojer14:07:39

she just killed off the Labour party completely now?

martintrojer14:07:49

An economy that works for everyone, Reforming the economy for greater shared prosperity, Putting people back in control, Giving people more opportunity, Getting tough on corporate irresponsibility

xlevus14:07:20

Reading your emails, finding a way to leave the ECHR,

martintrojer14:07:48

don't forget mandatory fox hunting

dominicm14:07:22

If you disagree with her, you're a terrorist.

martintrojer14:07:57

remember this slack is stored and scrutinized by the lads over at GCHQ. 👋

xlevus14:07:39

@martintrojer: no, that'd be domestic spying and thus illegal

martintrojer14:07:04

since everyone is a terrorist until proved otherwise?

xlevus14:07:48

It's stored and scrutinized by our friends over at the Bundesnachrichtendienst, anonomised through a secure rot13 algorithm, and then supplied to our friends at GCHQ

mccraigmccraig14:07:49

let's just agree that all our communications are steganographic and that any ciphertext resemblance to idiomatic english is purely coincidental

dominicm14:07:27

wh47 d0 y0u m34n 3n6l15h-l1k3?

dominicm14:07:29

That's my favourite origin story for leet speak.

thomas14:07:40

something tells me there might well be a discrepancy between what May says and what she’ll actually implement and condone (ie. not really doing anything about tax avoidance etc.)

mccraigmccraig14:07:45

also, anyone's statements should be updated in bayesian fashion using their prior performance at achieving same... any conservative statement claiming "reforming the economy for greater shared prosperity" should have the posterior distribution quartiles suffixed and so should read something like "reforming the economy for greater shared prosperity [0, 0.1, 0.2]"

thomas15:07:57

so May will be PM on Wednesday…. when… ohhh… when will she press the Article 50 button?

thomas15:07:16

and watch the market go into even further decline...

thomas15:07:06

hmm maybe I should move my £££ to EEE

mccraigmccraig15:07:14

@thomas i won't be making any long bets on the future of the €. CHF seems like a better bet atm, though i have an awful record at predicting FX pairs, so you should ignore me

thomas15:07:16

I don’t have a CHF or $$ account, only an Euro one (besides my local £ account of course)

korny16:07:46

I have savings in AUD :)

korny16:07:08

Trying to double guess when the pound is going to bottom out...

korny16:07:08

Dammit, the pound went up today :( Bloody Tories.