I typically use closures to do this in other languages, but the syntax is always so cumbersome. You get the "dog balls" that Douglas Crockford always called them:
``` const config = (() => { const raw_data = ...
...
return compiled;
})()'const result = config.whatever;
// carry on
return result; ```
Really wish block were expressions in more languages.
(He also has a more elaborate one, where the partners do a virtual auction of all items among themselves, to account for cases where particular items are worth a lot more to one of them. I believe it’s in his book “How I Found Freedom in an Unfree World”).
(I speak from experience. I've seen a lot of credentials leak together with source code. This meant I saw "secret" paths where Adminer was hosted on a given site. Having database credentials meant I didn't have to somehow circumvent network security to get to the database itself. [Yes, I disclosed all of this to the server operator and even got a measly $50 gift card out of it :-)])
It's convenient I will say that. I've tried not to replicate this exactly and instead have adminer running on a server on the network but only listening to localhost connections. To get access to it you can then SSH tunnel the ports locally:
> # Route 8082 on your machine to localhost:8080 on the server: > ssh -N -L 8082:localhost:8080 db.devopsdomain.com
Either I am stupid or Mac is bad at discoverability.
^<.*>$|^<<.*>>$|^<<<.*>>>$ ^(<(<(<(<(<(<<>>)*>)*>)*>)*>)*>)*$
If we had named captures: ^(((?<P><)|(?<-P>>))*(?(P)(?!)))$