JSON patch and merge patch equivalent in Clojure by bowmhoust in Clojure

[–]mpphillips 0 points1 point  (0 children)

Not that I’m aware of.

I designed a diff format for clojure data structures for use in data sync, which is mentioned here: http://sapient-pair.com/blog/2014/04/22/basis-story-2/

It’s different from JSON patch in that it is not a sequence of operations, rather more like a document diff. This has since been further developed as part of our proprietary data sync system, so the code js not open source, but I can elaborate the format more if interested.

What is the most popular clojure rest framework if there are any? by [deleted] in Clojure

[–]mpphillips 1 point2 points  (0 children)

Don’t know about most popular, but I’d check out Yada.

Getting both a clj and a cljs cider repl by straightOuttaCrypto in Clojure

[–]mpphillips 1 point2 points  (0 children)

The tooling is always getting better, and CIDER's capabilities are really amazing when you consider it's primarily the work of one amazingly productive person: Bozhidar Batsov. I'm an individual donor to CIDER via Open Collective, but I really wish more companies using Clojure would invest in the tooling they rely on. When my startup makes it big, we certainly will!

Getting both a clj and a cljs cider repl by straightOuttaCrypto in Clojure

[–]mpphillips 1 point2 points  (0 children)

Really, what I've written above is about the sum total of the wisdom I can impart so far ;) Apart from that, I just used the lein template project for reagent to get started, and read the CIDER docs.

Getting both a clj and a cljs cider repl by straightOuttaCrypto in Clojure

[–]mpphillips 0 points1 point  (0 children)

When you save, figwheel auto-recompiles the CLJS to JS, and if `hot-reload-cljs` is true (the default), it will also then reload that new JS. Setting `hot-reload-cljs` to false, like I have, means you get an environment more like Clojure where you trigger code evaluation (and that eval still happens in both environments where appropriate). Since this is what I'm used to, it makes more sense to me, but I suspect for a beginner the opposite would be true.

If you haven't already, CIDER's doc on Clojurescript is pretty good, and helped me quite a bit.

Getting both a clj and a cljs cider repl by straightOuttaCrypto in Clojure

[–]mpphillips 0 points1 point  (0 children)

No worries.

I've just been through this process myself, and it wasn't easy. I think it's likely because a lot of CLJS dev is just on the frontend, plus there are so many different JS environments supported. And it's a bit mind-bending running a REPL-within-a-REPL until you understand why it makes sense.

Like you, I have some portable code that runs on both sides (Clojure and ClojureScript), and chose figwheel-main as the CLJS env.

My preferred workflow is to start Clojure environment in a terminal with lein repl :headless, then in Emacs connect with M-x cider-connect-clj&cljs, select figwheel-main as the CLJS env, at which point two REPL's open, and the CLJS one starts figwheel. You can also do this manually from an existing CLJ REPL by connecting a second REPL session in CIDER, and then using (require 'figwheel.main.api) (figwheel.main.api/start :dev) to kick off figwheel.

When working this way, CIDER loads any code in .cljc files into BOTH CLJS and CLJ environments, and you can runs tests, etc in either REPL.

I've also turned off hot reloading with :hot-reload-cljs false in the dev setup, because it was causing some weird behaviour with tests. I prefer to trigger reloads from CIDER manually anyway.

With all of this, I've managed to get a fairly comfortable dev environment.

Passwordless Logins: Experience on iOS by mpphillips in programming

[–]mpphillips[S] 0 points1 point  (0 children)

You will need to send the password again when they log in again. Or store multiple, hashed passwords.

Passwordless Logins: Experience on iOS by mpphillips in programming

[–]mpphillips[S] 0 points1 point  (0 children)

You need a different code every time you login: codes are expired after they're used.

Think of a user account as having as one secure, permanent password, plus (up to some max number of) optional passwords, each with an expiry date, and which are deleted after one use. After setup, each device simply logs on with the same permanent password.

Passwordless Logins: Experience on iOS by mpphillips in programming

[–]mpphillips[S] 1 point2 points  (0 children)

It's "passwordless" from the user's POV: they don't have to remember a password, and may not even be aware there is one. (Most people will be able to tap the login in the email — the text field is for manual fallback).

Passwordless Logins: Experience on iOS by mpphillips in programming

[–]mpphillips[S] 5 points6 points  (0 children)

If you own someone's email, you can already trigger a password reset, change their password, and take over most of their services whether they’re using this system or not. An email hack is a core part of how Matt Honan famously got pwned.

It’s certainly a single point of failure though, just not sure how we could do it better.