Fork me on GitHub
#off-topic
<
2017-09-27
>
dominicm07:09:47

I hear everyone hiring in Clojure comment that they train up most of their devs & have no issues.

qqq09:09:10

what's the going salary for a clojure programmer who's given multiple talks at clojure conj / clojure west ?

qqq09:09:21

500K/ year? 1M / year ?

hmaurer09:09:35

I highly doubt so ๐Ÿ˜„

pesterhazy09:09:20

Any simple solution (as in the simplest solution that could possibly work) to prepending uuids/asset-ids to index.html for production?

<script src="js/bundle.js"></script>
should become
<script src="a3664ad7-50df-450a-b772-2d67e0c37943/js/bundle.js"></script>
and similarly for css files?

dominicm09:09:09

@pesterhazy is this for caching?

dominicm09:09:42

also, why prepend & not append?

dominicm09:09:55

This is what I see the most: /js/bundle.js?v=a3664โ€ฆ

dominicm09:09:20

If you want to be truly lazy though, ETags are your friend

pesterhazy09:09:28

@dominicm It is for caching, but I prefer prepending an asset-id as a directory. So you can upload each version to an S3 bucket in your CI job and not worry about clobbering old files - each asset-bundle is immutable and neatly separated.

dominicm09:09:10

I see. I guess your CI job will need to generate an edn file which contains the hashes of files, and whatever you use to generate your html will need to read that file.

pesterhazy09:09:55

hm I'm actually not planning to hash each file - I just assign a hash for each bundle/build

pesterhazy09:09:16

makes things a bit simpler - people will have to redownload everything for each release though

dominicm09:09:16

Even better then ๐Ÿ™‚ just upload a plain text file with that id

pesterhazy09:09:47

right but how do I patch it into index.html? It's a static file

dominicm09:09:17

gotcha. Mustache & CI generate it?

dominicm09:09:35

if you're using boot this of course becomes easier

pesterhazy09:09:55

yeah it will be generated on CI - but mustache doesn't seem like the simplest possible thing

pesterhazy09:09:11

I was thinking something like this

dominicm09:09:21

Regex replace a known sentinel?

pesterhazy09:09:20

<script src="js/bundle.js"></script> <!-- FINGERPRINT_REPLACE: s/js\//$ENV{ASSET_ID}\/js\// -->

pesterhazy09:09:30

exactly ๐Ÿ™‚

pesterhazy09:09:41

where what follows FINGERPRINT_REPLACE is a perl expression ๐Ÿ™‚

dominicm09:09:22

I think I'd go simpler

dominicm09:09:46

<script src="<!-- FINGERPRINT_SENTINEL -->/js/bundle.js"></script>

pesterhazy09:09:55

is that valid html?

dominicm09:09:01

good question

pesterhazy09:09:09

comments inside of strings

dominicm09:09:49

I mean, it doesn't have to be a comment, could also be $$$FINGERPRINT_SENTINEL$$$, just has to be a string you won't use under normal circumstances in the html

pesterhazy09:09:41

but then it doesn't work for local development anymore

dominicm09:09:49

ahhh, now I understand

dominicm09:09:42

Well, you could run it through the fingerprint sentinel replacer with it set to ""

pesterhazy09:09:14

hmm comments insides strings are not valid

pesterhazy09:09:50

I'd prefer to have no preprocessing step for dev use

pesterhazy09:09:59

but I realize my requirements are becoming esoteric here ๐Ÿ™‚

dominicm09:09:52

> Error: Bad value <!-- comment -->js/bundle.js for attribute src on element script: Illegal character in path segment: < is not allowed.

dominicm09:09:04

It's not comments, it's generally <

dominicm09:09:01

Interesting to learn anyway

dominicm09:09:00

Depending on your dev setup, with/without preprocessing step is easier/harder. We generate a version.cljc via boot, and it works fine in dev/prod without thinking just by design (there's no special case or anything).

pesterhazy09:09:49

yeah boot is not a bad solution, but I'm going to try the minimalist approach

dominicm09:09:52

when I say "via" I mean "as part of", I am perhaps not grasping the full breadth of your constraints though ๐Ÿ™‚

dominicm10:09:28

I didn't expect the s:โ€ฆ: to be so easy ๐Ÿ˜†. Perl is obviously greater than I have respect for.

pesterhazy10:09:59

perl is still unmatched (ha!) for regex

qqq19:09:50

I have an RGB buffered image. I'm interested in adding noise to it: * salt & peper noise * gaussian noise * camera distortion effects What's a good existing java library to do all this for me?

noisesmith19:09:31

processing has a lot of good functionality (and you donโ€™t have to use itโ€™s beginner friendly DSL)

noisesmith20:09:54

yeah - itโ€™s meant to be a beginner friendly environment for multimedia, but under all that thereโ€™s a java lib with good image manipulation functionality (among a bunch of other things)

qqq20:09:03

also, can some admin remove the default/auto "include snippet of url inline" feature? I feel like I've always clicked the X and never thought "gee, I really wish it'd include an inline snippet" (though if others actually like this feature, keeping it as is would be reasonable)

qqq20:09:36

yeah, I've always viewed processing as "generative art" -- but the existence of an underlying image processing lib makes sense

seancorfield22:09:07

@qqq Not sure what feature you're talking about there?

qqq22:09:23

@seancorfield: in the above example, it auto throws in a snippet of the website

qqq22:09:38

which I generally remove by clicking the X, as it conveys no new info and just clutters the chat

seancorfield22:09:03

We can turn that off on a per domain basis -- but I suspect a lot of people find that useful. We have http://youtu.be link expansion blacklisted.

qqq22:09:29

ah, okay, I didn't realize people actually liked the feature ๐Ÿ™‚

seancorfield22:09:33

@qqq I'm sure some GitHub URLs do not add value for being expanded -- because they have well known and/or descriptive org and project names -- but there are many GitHub URLs that are pretty opaque. It might seem odd if we arbitrarily "blacklisted" expansion of those popular, well-known projects but not more obscure ones... Can't please everyone ๐Ÿ™‚