• 0 Posts
  • 18 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle
  • 418teapot@lemmy.worldtoSelfhosted@lemmy.worldProgrammatic access to discord
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    10 days ago

    It is likely not worth your effort as whatever you come up with will likely result in discord deactivating your account for breaking their ToS, or them breaking their API forcing you to constantly play catch-up.

    This is why open communication protocols are so important. Email is still as ubiquitous as it is because it’s a protocol, not an API.

    I personally think it would be less overall effort to get your friends to switch to an open protocol like matrix, or XMPP than it would playing cat and mouse with proprietary APIs. But you do you, I wish you the best of luck!




  • Since I like to use bemenu I just wrote the derivation myself, it’s super short and simple especially borrowing from the build.sh script in wofi-emoji repository. You can get the emoji data like so:

    emoji-data = pkgs.runCommand "emoji-data" {
            buildInputs = [ pkgs.cacert pkgs.curl pkgs.jq ];
            outputHashAlgo = "sha256";
            outputHash = "sha256-znAwFu0vq2B7lQ8uvG0xKv9j3jYr6P0CZpjoKMNPhZw=";
          } ''
            curl 'https://raw.githubusercontent.com/muan/emojilib/v3.0.6/dist/emoji-en-US.json' \
                | jq --raw-output '. | to_entries | .[] | .key + " " + (.value | join(" ") | sub("_"; " "; "g"))' \
                > $out
          '';
    

    And then write a small wrapper script of your liking. I’m using wtype and bemenu, but you could just as easily use wl-clipboard and rofi for instance. This is to me one of the huge benifits of nix, how you can slam these small scripts together and not worry about missing dependencies when taking the configuration to other systems.




  • Definitely agree, but your link is protected by cloudflare (yet another centralized service destroying the internet) and therefore I’m unable to get through because I have privacy.resistFingerprinting enabled on my browser so cloudflare is unable to determine I’m human I suppose.

    I despire youtube and it’s monopoly, and I think it get’s an appropriate amount of hate on here and HN, but what confuses me to no end are the people who complain about youtube turn right around and constantly recommend cloudflare. Can someone explain what I am missing?




  • Can someone explain to me why I keep reading about people having problems plugging in USB A connectors upside down? I feel like I’m taking crazy pills. Per the spec, the holes always go up. They indicate the correct way to plug in the port. Not only that, but the printed logo on the connector also always goes up.

    The only time this is SLIGHTLY confusing is if you have a desktop tower where the motherboard is essentially mounted sideways, but for that case it just takes an extra second to think which way is “up” from the perspective of the motherboard.

    And before anyone says “who reads the spec?”, it feels like I subconsciously knew this for something like a decade before I even knew what a spec was.






  • I haven’t used any flatpacks, mostly because they don’t seem to have a good solution for running terminal programs. (Also I don’t like that the application developer chooses the permissions to expose rather than the user.

    However, I have been using bubblewrap which is what flatpack uses under the hood to sandbox. This allows me to run both gui and non-gui programs, and I have the control of exposing the minimum required permissions that I’m comfortable giving an untrusted piece of software.


  • I seem to be in the minority here but I personally prefer using $ and # to denote root. I like this because not everyone uses sudo and might not even have it installed.

    That being said, if you already have other commands that are using sudo -u ... to run commands as a different user then it might be best to just be consistent and prefix everything with it, but if there is only a few of those maybe a # cp foo bar && chown www-data bar is an alternative.


  • Rust has a strong emphasis on strongly typing constraints. So if a collection of fields are always some/none together having them listed as separate options in the struct means there is some assumptions you are making that the type system isn’t aware of which can lead to pain and bugs in the future.

    I agree that separate types with Into sounds like a nice solution to me, it would be good to see the error the compiler is giving you (or if you can a minimal reproducible repo). If you absolutely can’t make it work, a single Option<Inner> at least would be more correct as all the fields on the inner struct would be optional together.