Fork me on GitHub
#off-topic
<
2022-09-27
>
Ivar Refsdal07:09:35

TIL that you can instruct docker-compose to fail if there are undefined or empty environment variables: ${VARIABLE:?err} exits with an error message containing err if VARIABLE is unset or empty in the environment. ${VARIABLE:err} exits with an error message containing err if VARIABLE is unset in the environment. Example:

services:
  postgres:
    container_name: postgres
    image: postgres:13.2
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Please set POSTGRES_PASSWORD}
The console output will be something like the following if the variable is not set or empty:
invalid interpolation format for services.postgres.environment.POSTGRES_PASSWORD.
You may need to escape any $ with another $.
required variable POSTGRES_PASSWORD is missing a value: Please set POSTGRES_PASSWORD
There are no complaints about interpolation if the value is set.

👀 5
vonadz13:09:17

Just wanted to show off a bit what I made 😉 maybe it'll give someone some interesting ideas. This is the internal dashboard I use to curate my newsletter. Articles on the left feed in from my feed aggregator, the content gets scraped for salient information using https://github.com/chimbori/crux, unwanted articles are filtered (currently just based on length), keywords are extracted using https://github.com/MaartenGr/KeyBERT, articles are saved and then loaded into the dash which is made using svelte (http://svelte.dev/). I can also generate summaries on demand using OpenAI's GPT-3. Everything is glued together using clojure. PS. picking the first article takes a while because I got distracted.

clojure-spin 4
pavlosmelissinos13:09:40

Wow, looks neat, congrats! Is GPT-3 available for download or are you using the API?

vonadz13:09:57

Just using the API. I haven't seen it available for download yet.

👍 2
Cora (she/her)15:09:53

ooooh is this going to be open sourced?

1
vonadz15:09:44

Hmm... I wasn't really considering it, since it's two separate projects (one for the dash, one for doing all of the cool backend stuff) that share the same DB. It would need a bit of a rework to make it into one open source project. I'm not opposed to it, just have different priorities currently.

vonadz15:09:17

Also trying to spin part of it (plug in url -> get summary) into a paid product. Not sure how popular it'll be though. Although to do that, I'd probably need to make that part into a separate thing, so I could open source that.

Cora (she/her)16:09:19

I ran clojure morsels and this is essentially what I had in mind to build to make it easier to put together

Cora (she/her)16:09:25

which is why I ask

Cora (she/her)16:09:36

I totally understand not wanting to open source it, though

vonadz17:09:39

Yeh it would be pretty handy for you in that case (with some tweaking to match your process flow). I'll let you know if I ever do