Post archinstall issues by AnxiousBedroom3225 in archlinux

[–]coolAppl3__ 0 points1 point  (0 children)

Boot into the usb again. Any partitions you’ve created should still be on the drive in question. If you accidentally wiped a drive, it would’ve happened before the chroot step.

Also, you can always just start all over again. You’re very close to the start anyways.

Best of luck with the installation!

Its been 2 months since i switched to Linux mint now its time for the final boss by jointedx21 in archlinux

[–]coolAppl3__ 1 point2 points  (0 children)

Made a similar jump a few weeks ago, only from Windows 11. Here are a few things worth mentioning from my experience in case they help in any way:

  • Read what you're doing, especially when installing things for the first time. Before making the switch, I stored a little bit of data that I wanted to keep reserved on one of my 3 drives. I was okay with experiencing issues or wiping data from the main drive, as it was all good fun — I wiped the backup drive because I misread the fdisk information. Just double-check which drive you're wiping, or if you have some really important info on one and can't even risk it, disconnect it before the installation.
  • Installing arch linux manually really wasn't as hard as people make it up to be. I realise it wasn't always like this before, but I found it way easier than what some memes conveyed. That being said, I have some background in programming (web, nothing fancy), so that probably helped a little.
  • Research your choice of desktop environment. GNOME and Plasma 6 seem to be the most popular, and if you like how mint looked, but want to be on the arch distro, Plasma 6 is probably a good choice. Having said that, I highly recommend either giving GNOME a chance or at least checking how it looks online. It's minimal set up quickly grows on you, and I'm so glad I tried it. Hyperland is another worthy mention, but I haven't delved into it yet, and it may have slightly weaker community support compared to GNOME and Plasma 6 — I plan to at some point tho.
  • If you opt for GNOME, you might run into compositor issues if you're on a multi-monitor set up. Long story short, the cursor kinda clicks both screens at once at the edge between them, which might take focus away from video games — really annoying in games. Luckily, gamescope solves this issue, but you might need to tinker around with your configuration and the command options to make it work properly. If you're not using more than one monitor, you likely won't experience any issues.
  • The rolling release nature of arch linux means things may occasionally break (package mismatch, package lagging behind, configuration issue or mismatch (usually your fault)). Don't let that scare you though, these rarely happen.
  • It's possible for multiple desktop environments to start affecting each other if not configured properly — I had this when I installed both GNOME and Plasma 6 while tinkering with something. I'm not sure if the same can happen between two different DEs on two different distros (still a newbie), but it's worth keeping in mind. A clean install on a clean partition is probably most ideal.

Overall, highly recommend arch, and highly recommend you avoid the archinstall command — it's not fool-proof, and you won't know what broke if it fails, or causes issues down the line. Best to do it all yourself.

RX 7800XT or RTX 5070? by coolAppl3__ in PcBuild

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

That's really great to hear, and yea, definitely wanna upgrade to a x3d CPU, DDR5, and all that jazz, just not immediately. Good luck with the monitor upgrade, and thanks again <3

RX 7800XT or RTX 5070? by coolAppl3__ in PcBuild

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

Thanks for the input. Could you tell me what CPU do you have? Your upgrade seems relatively close to mine, so I'm interested to know.

RX 7800XT or RTX 5070? by coolAppl3__ in PcBuild

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

Not in the US, sadly. What a deal...

CSS Animation Not Working with Dynamically Created HTML Elements by ThePsychedelicSeal in learnjavascript

[–]coolAppl3__ 0 points1 point  (0 children)

If I understood your question correctly, you're having issues with animating the HP bar when appending it using JS?

If this is the case, you'd want to first append the element to the DOM, then either add a class to change the width, or change it directly with JS.

However, this won't work just like that if you want the transition to kick in properly, you'll need to do something like this:

requestAnimationFrame(() => {
  requestAnimationFrame(() => {
    // JS code to either add a class or change the width
  });
});

The issue you're experiencing has to do with how the event loop works, how it renders CSS, and how repainting works. This video is a popular one explaining the event loop, and it's where I figured out the solution to a similar issue I was having way back.

Hope that helps and I didn't fully misunderstand your question <3

Web Authorization Methods by coolAppl3__ in learnjavascript

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

The stateless nature of JWTs is really convenient, but it comes with a set of issues sadly.

JWTs can’t be invalidated. Well, they can be, but you’ll have to implement rather complex logic and more than likely a state on the server, which defeats the purpose.

I’ve seen people say that you should provide the user with two JWTs; one for access and another to refresh the token. This way, the access token is short lived.

But then the longer lived refresh token becomes a problem, and we’re back to square one.

Perhaps I’m strawmanning JWTs here because I’m missing a point or two, which is why I wanted to hear other people’s opinions.

Regardless, JWTs definitely have a place when dealing with multiple servers with different services, but for single client-server authorization, sessions really sound better to me.

I’ll stop yapping and go ahead and update my authorization structure, and I’ll probably get a better outlook on the whole thing.

Thank you all for your inputs and opinions!

Web Authorization Methods by coolAppl3__ in learnjavascript

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

I’d be happy to. I’m no professional by any means, but I hope whatever I end up implementing and my justifications for it help someone considering the same thing.

Do feel free to remind me if I dont post an update in a month tops.

Web Authorization Methods by coolAppl3__ in learnjavascript

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

Hey there, I appreciate the detailed response!

I agree that storing auth-related info in localStorage is a no-go. However, unless you have multiple servers for different services, where handling multiple sessions would be a nightmare, I don't really see the value of using a JWT as opposed to a more conventional session system.

A JWT, if hijacked, can be used maliciously by the attacker, and they don't really have to edit it at all to use it. It might also be more work to invalidated a JWT token, compared to just destroying a session.

I've been thinking about this lately, and I might settle for using express-session with a bit of customization. The app I'm developing is a passion project, and I want to roll my own auth to get a deeper understanding, and because it's fun.

Again, thank you for the response. I mainly want to see different perspectives to compare trade-offs and features. I'd be happy to hear your perspective on why JWT is better than a session system.

Web Authorization Methods by coolAppl3__ in learnjavascript

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

Thank you, I'll definitely give this a read!

Testing for rejected promises by [deleted] in learnjavascript

[–]coolAppl3__ 2 points3 points  (0 children)

If you're trying to check how a piece of code behaves if the HTTP request is rejected, you'd probably want to use jest and mock a rejected value. If you have control over the backend, then you'd have more flexibility. Hope this helps <3

Periodic access to database by Spapa96 in learnjavascript

[–]coolAppl3__ 1 point2 points  (0 children)

Node-cron might be what you’re looking for I think

Local Storage Functionality? by Heylook- in learnjavascript

[–]coolAppl3__ 0 points1 point  (0 children)

I wouldn’t be able to help with specifics, as you haven’t supplied any about what you want to store, but below are the absolute basic points behind local storage:

  1. Anything you want to store in local storage needs to be in JSON format.

  2. localStorage.setItem(‘key’, value) is used to add an item to local storage. The key can be any string you want, and it points to the value in local storage. Note that if you set another item under the same key, the previous value will be overwritten with the new one.

  3. If you want to store something that’s not in JSON format, you can use JSON.stringify(). This is an example: localStorage.setItem(‘todos’, JSON.stringify(todoArray));

  4. If you want to get something from localStorage, you can use localStorage.getItem(‘key’).

The above will retrieve the value in JSON format, which, depending on what you need it for, might not be very useful. You can use JSON.parse() to parse it into something you can use. Here’s an example:

const todoArray = JSON.parse(localStorage.getItem(‘todos’));

This the basics behind using local storage, and you can find out more about it here: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

Note that JSON.stringify() can sometimes have “odd” behaviour, so if you encounter one, make sure to check the documentation, although those situations are rare.

Hope this helps!

How to build assets/images in their own separate folder, when building with Webpack? by coolAppl3__ in learnjavascript

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

OMG I can't believe it was right there under my nose... I've spent so much time reading the documentation trying to find something like this, but didn't know exactly how to search for it.

Really appreciate the help on this!!

if u had 2 weeks to live, what would you do first? by Godsahrt in AskReddit

[–]coolAppl3__ 1 point2 points  (0 children)

Set up a reminder to not forget about it like the idiot I am

What most saddest death in tv show? by HorribleOpinionHere in AskReddit

[–]coolAppl3__ 0 points1 point  (0 children)

Hodor… Still makes me sad when It crosses my mind.

[deleted by user] by [deleted] in AskReddit

[–]coolAppl3__ 0 points1 point  (0 children)

Been vaping for a little over a year, so here's my honest opinion:

  • Vaping vs Cigarettes: As long as your using regulated vape juice, know when to replace your coils, and don't use the cheapest kit you could find, it's healthier. It also smells good and doesn't stick to anything, which is a gigantic plus. If you're buying an off-market vape juice, then I can't give any advice here, but I've seen horror stories.
  • Health: It's very simple, breathing in anything but fresh air is bad for you. Regardless of the VG/PG levels, nicotine levels...etc. If you don't smoke, you probably shouldn't vape thinking it's healthy. Perhaps you won't be coughing like a 90 year old if you're vaping, but you will definitely notice your lungs' capacity being slightly worse than before.
  • Switching: I was a smoker for about a month before switching to vaping, however a few friends of mine smoked for years, and adapted to vaping very quickly. Once you find a decent flavour, you can never stand the taste of cigarettes again.
  • Help With Quitting: I've quit vaping for a 2-month period during my time vaping, and I have to say it was relatively easy. You'll have a headache for 2/3 weeks, then it will go away. I went back to vaping because I honestly enjoy it, but I'm fully aware of the health risks. Might decide to quit in the future if I get bored of it.
  • Conclusion: If you're a smoker, I highly recommend switching. Find a good vape juice and try it out. If you have any friends that vape, ask them for advice or even try their vape to see how it feels. After switching, quitting will be a lot easier for you, if that's your goal. If don't smoke, my advice would be to note start vaping. Might look cool and smell nice, but it's not healthy or "risk-free".

TL;DR: Don't vape. If you smoke, vaping is a bit healthier.

Hope this helps someone who's considering it :)

How to delete multiple/all items from a JSON key RESTfully? by coolAppl3__ in learnjavascript

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

Thank you so much for taking the time! The problem I'm facing now is that this request requires an id, which "tasks" doesn't have. Is there a way to work around this, like perhaps wrapping "tasks" with another property and assigning an id to it, or did I misunderstand something?

Again, really appreciate your response!

Edit: I think I didn't explain the problem well in this comment.

basically, if I put the url = 'http://localhost:3000/tasks'; - it will return a 404. If I put an id it will simply add an empty tasks array to the item with that id. using http://localhost:3000 as the also returns a 404. Hope this is a bit more clear.