I code as a hobby, and for a living 👨‍💻

Creator of Leomard App 🐱

Join the !leomard@lemm.ee!

  • 19 Posts
  • 82 Comments
Joined 1 year ago
cake
Cake day: June 30th, 2023

help-circle




  • Two reasons for me, but they’re mainly because of the MagSafe:

    1. In the car, I just plop my phone onto the charger, and it holds it and charges it.
    2. At home, I also use iOS 17 Beta, so I can use the StandBy.

    Of course it has its drawbacks, but this assumes that I need to use my phone all the time (no), I can’t spare even 5 minutes to not charge, or that I need to top up from 10% to 100% in 5 minutes for some reason, which I don’t. If I do, then sure, I use the cable. Through the past year, I needed to charge my phone through the cable maybe twice.


  • Ok, so basically, there is multiple ways one could comment count. The most obvious option is to count the actual number of comments under the post. This might be in practice slow, as you must load all comments under the post. An alternative approach is to have a count variable for post, which is increased or decreased by 1 if post is added/removed. It’s way faster to retrieve that variable, instead of getting all comments and counting the number of them. The problem starts if some anomaly happens that is not accounted for, so for example, if I request the same comment to be deleted multiple times. So that counter can be decreased more than once for the same comment. This could be fixed pretty easily:

    if comment_to_delete is deleted {
    	// Do not do anything
    	return
    }
    
    post.comment_count -= 1
    delete_comment(comment_to_delete)
    

    And yeah, I thought so too, but ever since I stumbled upon this bug, I think the way the comment count is stored is through the counter variable.








  • As an author of one Lemmy front-end, I can confirm that you are potentially sharing your username and password. Unfortunately, there is no way for Lemmy front-end developers to, say, open a web socket to Lemmy instance and have you login through a web browser (which would be much prefered from security standpoint, but it is what it is).

    Furthermore, from what I see, many of such front-ends store your password, instead of just the Bearer token. Unfortunately, from what I get, there is also no way of invalidating the Bearer tokens right now, so in the event of it getting stolen - you’re f***ed.

    Now, couple of tips:

    • USE 2FA AUTHENTICATION. In the event of malicious app actually stealing your credentials, you are at least a little bit more protected by this layer.
    • Use password manager - do not use your banking password, please.
    • Only use trusted front-ends, and in the even of an app, only download versions from official sources maintained by the app author.
    • Make sure the instance you’re registered at has a valid HTTPS certificate.