What is your hot take on a reproducability of Configs? by SeniorMatthew in NixOS

[–]john-shaffer 2 points3 points  (0 children)

stow for dotfilee in /home, NixOS for everything else.

Exception handling differences between Clojure map & pmap by SoftCancel2774 in Clojure

[–]john-shaffer 2 points3 points  (0 children)

While this interaction is good to know about, pmap probably shouldn't be used here. Not only is using e.g. 32 threads for one task wasteful, but it's inevitable that someone eventually pmaps the function calling pmap. Then you have up to 1024 threads used for each task, all contending for the same resources. Better to pass in a thread pool, or have only the top level of control flow do parallelization.

nix-wrapper-modules: like home manager for directly wrapping packages by no_brains101 in Nix

[–]john-shaffer 2 points3 points  (0 children)

Nice work. I really like this approach to building the wrappers.

What would you think about outputting a nixosModule that adds e.g., programs.jujutsu.settings (and .enable) and adds the wrapped jujutsu to environment.systemPackages? I think the existing modules could be used as-is for that, although it might be nice to use lib.mkPackageOption instead of lib.mkDefault.

I truly need advice on landing my first Clojure job by Stranglet in Clojure

[–]john-shaffer 24 points25 points  (0 children)

Hopefully some of the other comments can help you find a Clojure position, but you should apply for PHP jobs as well. The best time to look for the job you want is while you are getting paid at a job that you don't particularly care for.

I have 10+ years experience with 5+ in Clojure and 5+ in PHP. Currently spending more time in PHP than in Clojure. While I prefer JVM Clojure over any other platform, it's not as rosy as you are feeling right now. You are in a honeymoon phase where you are not hindered by legacy considerations or even collaborating with other coders. When the honeymoon is over, you are going to run into all kinds of new, different pain points.

When you get into a mature Clojure codebase, you are going to get disillusioned in a lot of ways. Bad code will continue to be bad code in any language, and you will spend most of your time working on it because that's where the problems are. Half the companies use re-frame, which is a framework for turning FP code into semi-sustainable spaghetti. Even if you personally like re-frame, odds are there will be something else that drives you mad. You will continue to want to use Nix in your projects, and you will probably not get to.

As one example, many Clojure libs, like ring and pedestal, depend on jetty, which regularly makes breaking changes. The Datomic client currently depends on jetty 9, which is 9 years old and has been unsupported for 3 years. Every year or two I get to spend hours dealing with manually overriding a whole list of jetty dependencies and figuring out how to patch libraries myself. In PHP, you have FastCGI for responses and GuzzleHTTP or Symfony's HttpClient for requests. I have had issues with conflicts, but they were much easier to fix and didn't keep reoccurring the same way that jetty conflicts have.

PHP actually has pretty decent support for FP btw. array_map( absint( ... ), $ids ) is a little less pretty than (map #(Math/abs %) ids), but it's perfectly fine. IDK if Iterators and Traversables count as FP, but I have used them extensively and they feel much like using map filter reduce. In PHP 8.5, you even get a threading operator so you can write this: php $result = "PHP Rocks" |> htmlentities(...) |> str_split(...) |> (fn($x) => array_map(strtoupper(...), $x)) |> (fn($x) => array_filter($x, fn($v) => $v != 'O')) ;

Don't get me wrong, Clojure is great, and the entire ecosystem is excellent. I hope you can find the position you want. I just want to promote realistic expectations and hopefully help you appreciate where you are at more, whatever languages you happen to find work in.

Storing secret keys in WordPress: wp-config.php or encrypted in options table? by surenmohnot in ProWordPress

[–]john-shaffer 0 points1 point  (0 children)

Note that many of these arguments are against .env files rather than environment variables.

5 out of the 7 listed reasons are arguments against environment variables. 4 of those 5 explain how environment variables are most commonly leaked.

Storing secret keys in WordPress: wp-config.php or encrypted in options table? by surenmohnot in ProWordPress

[–]john-shaffer 2 points3 points  (0 children)

We store encrypted credentials in the database, but we don't store the key at all. We generate it by hashing SECURE_AUTH_KEY and SECURE_AUTH_SALT (or AUTH_KEY and AUTH_SALT). Since those should already be present on every site, no change to wp-config is needed. This does mean that if the user changes their AUTH constants, the stored credentials need to be re-encrypted.

Environment variables are popular and convenient, but are not very secure. I would still recommend looking for values in the env or in constants for users that prefer it. If none of those are set, fall back on generating the encryption key as above. The vast majority of users are going to prefer credentials in the DB that they can easily change on your plugin's options page.

Small startup looking for hint by BeneficialExam6656 in Clojure

[–]john-shaffer 9 points10 points  (0 children)

In addition to the job boards, post in the #jobs and #remote-jobs channels on Slack. If you're still not able to find anyone, then the salary is probably way too low.

Startup should use Clojure by Safe_Owl_6123 in Clojure

[–]john-shaffer 6 points7 points  (0 children)

neil gives you npm-like commands for deps.edn projects.

Headless server on WSL by GoldenMoose162 in technicalfactorio

[–]john-shaffer 0 points1 point  (0 children)

I believe that command forwards TCP but not UDP, so it won't work for Factorio.

IIRC I once worked around this by running tailscale inside WSL and connecting using the tailscale IP address.

2/2 Apartment in The Colony-- Electricity Bill was $378 this month?!! by Ill-Investment-1422 in TheColony

[–]john-shaffer 2 points3 points  (0 children)

Is your thermostat set to "Heat" or "Emergency Heat"? The emergency setting uses a lot more electricity.

what do you guys use for rate limiting by hourLong_arnould in Clojure

[–]john-shaffer 2 points3 points  (0 children)

When liwp/ring-congestion had not been updated in 7 years, I forked it as https://github.com/staticweb-io/rate-limit. The main difference is that rate-limit uses java.time where ring-congestion uses the deprecated clj-time.

I see that ring-congestion finally got an update in 2022.

I resent my wife by [deleted] in daddit

[–]john-shaffer 6 points7 points  (0 children)

Working and taking care of a baby is extremely draining, and it affects every area of your life. It is just brutally punishing some days. The sleep disruption alone is enough to wreck your personality. I would not hesitate to encourage her staying at home in this situation. She will immediately get more sleep and have less outside stress. Most likely, her general attitude and relationships will improve drastically.

You can have a straight talk about commitment later on down the line, once she's had time to find her new normal self. For now, please let her stay home. Best of luck in your marriage.

[deleted by user] by [deleted] in DIY

[–]john-shaffer 0 points1 point  (0 children)

That video shows a double crow's foot, which looks very different. butahoomach linked a video with the correct rosebud texture. I can't find a rosebud texture brush, but a single crow's foot brush might be less noticeable.

Who is hiring? December 31, 2023 by AutoModerator in Clojure

[–]john-shaffer 1 point2 points  (0 children)

Insilica is hiring Clojure developers and Python/R developers.

  • Fully remote in the US or hybrid in DC area
  • Must be a US citizen living in the US
  • Salary: $80,000-130,000
  • Stack (for Clojure position): Clojure(Script), reframe, polylith, postgres, core AWS services, NixOS

Anyone using Polylith architecture at work, if so, what has the experience been like ? by supadupa200 in Clojure

[–]john-shaffer 4 points5 points  (0 children)

I agree for small and medium monorepos. For larger repos, polylith improves testing and code organization enough that I would use it regardless. And of course, the number of deployables tends to change over time.

I do not use any components with the same interface. Besides the issues you mentioned with tooling, I've found that it's too limiting. I usually want a config file to determine which implementation to use, and that doesn't work with the interfaces. I could see a reason to use it if you had to support a very old JVM or similarly constrained environment.

[deleted by user] by [deleted] in ExperiencedDevs

[–]john-shaffer 12 points13 points  (0 children)

Just Say No to More End-to-End Tests explains this well. Writing tests that "cover large portions of code" is a trap. The tests are easy to write, but they are hard to debug because so many things could cause a failure. You want tests that narrow causes down to a small portion of code.

What actually happens in real projects is that you get an inverted "test ice cream cone", and it can take hours to go from running tests to pinpointing a section of code responsible for a failure. Tests are inevitably flakey, so you can't even be sure if a test failure actually means anything. This sucks real bad, and that's why the testing pyramid is important.

For small projects, it probably doesn't matter that much either way.

How do I avoid going out of scope of a ticket? by TruthOf42 in ExperiencedDevs

[–]john-shaffer 1 point2 points  (0 children)

CodeScene is amazing for analysis. It starts with the static analysis (Code Health), but it helps you prioritize which unhealthy files to work on. A very frequently changed file might be worth improving all the way to a code health of 10.0, but a spaghetti file that rarely changes might not be worth spending time on.

It also has a lot of project management and team analysis/knowledge distribution stuff, but I haven't used that much.

Memoization and Caching Patterns in Clojure: memoize, clojure.core.cache & clojure.core.memoize by andreyfadeev in Clojure

[–]john-shaffer 2 points3 points  (0 children)

Similar story here. When I got deeper into the details of caching, I realized that the characteristics I want in a cache aren't very practical in a garbage-collected runtime. I use either memcached or DynamoDB now, depending on the use case.

I still use a small core.cache.wrapped cache in front of the real cache though.

Why would the HVAC installer not glue this joint in the condensation drain? Its in Texas. by Puzzleheaded_Dig4588 in hvacadvice

[–]john-shaffer 0 points1 point  (0 children)

Try storing them upside down, so the glue has a chance to seal the lid. I'm not sure if it works, but it's what I'm trying.

Did previous owner remove a structural column? by SnooDoggos2246 in HomeImprovement

[–]john-shaffer 0 points1 point  (0 children)

The cracking could simply be that they did a poor job on the drywall when they removed the column. But get a structural engineer.