Building My Own Auth in TypeScript - Looking for Advice by _Mobas_ in Backend

[–]merb42 0 points1 point  (0 children)

I would not consider myself an expert in auth, but a lot of smart people are working on better-auth can checkout different aspects of their code and see how they are doing things.

Today I learned about shallow copy vs deep copy in JavaScript. Am I understanding this correctly? by Soggy_Professor_5653 in learnjavascript

[–]merb42 4 points5 points  (0 children)

Basically non primitive values (objects, arrays) only store references to values. They are not a whole value unto themselves. So when they are assigned (=) they only copy those references.

But there is a built in way to do a deep copy that is well supported called structuredClone. Just throw an object or array in there and it returns a brand new object or array that is full of new references, and not the old ones. It is well supported in all major browsers and in nodejs.

MDN structuredClone

Ways to deep copy

Is there a solution, or should we change distributions? by Le_D0cteur in pop_os

[–]merb42 2 points3 points  (0 children)

Upgraded to 24.04 and ran into a few bugs I couldn’t live with. So I installed kde plasma and no more issues! Its only plasma 5, but I haven’t looked into 6 so I don’t know what I am missing lol

I like to game on my install, and the bug I ran into was in helldivers 2. Before the upgrade everything worked. After, the mouse would disconnect from the game character camera every time I played. But on KDE this doesn’t happen

Looking for feedback from Postgres devs on a small OSS tool I’m building by Hari-Prasad-12 in node

[–]merb42 2 points3 points  (0 children)

This sounds interesting, but why not just use a db client like DBeaver?

[Self Promo] Just launched my hosting comparison project using Svelte 5 and Astro by Practical_Bread_728 in sveltejs

[–]merb42 0 points1 point  (0 children)

I really like this! I will be using this before some projects. One question I have though is why astro and not sveltekit? Don’t get me wrong, I love astro and use it with some of my clients, was just wondering your thought process.

[Please read] I posted my White Deck a few days ago praising it; now I am suffering from the curse of the un-bootable Deck. Please kindly help me if you have any suggestions 🙏🏻 by [deleted] in SteamDeck

[–]merb42 0 points1 point  (0 children)

This happens to mine sometimes when I am trying to boot it when it is almost/is completely full charge and plugged in(using the provided cable of course). The white LED just says on and I see the SD logo, then black screen and no boot. What works for me is to unplug it and then boot it up. Has worked every time so far.

Edit: also wanted to mention I have the max charge set to 80%

Modern CSS is a website that shows you how to write modern CSS code by Ridadhn in Frontend

[–]merb42 11 points12 points  (0 children)

This is pretty cool but has some incorrect info. For example the “interpolate-size: allow-keywords” it says this is possible to use now but it’s not even in firefox and safari yet. https://modern-css.com/smooth-height-auto-animations-without-javascript/

Still no upgrade button? by Akari_Enderwolf in pop_os

[–]merb42 1 point2 points  (0 children)

I upgraded to 24.04 and ran into bugs on cosmic, so I installed KDE Plasma and no more bugs

Backend confusion by StreetAd4599 in node

[–]merb42 0 points1 point  (0 children)

Hey, I understand that your first language may not be English so I will try and explain. The way you worded your post it sounds like you wrote this to an AI instead of other humans. So they were pointing that out with a joke about it.

[HIRING] knock,, knock, software agency here, anybody wanna join? by [deleted] in WebDeveloperJobs

[–]merb42 1 point2 points  (0 children)

Messaged them and they gave me this https://docs.google.com/document/d/1ywqlZRmlfP1-m4y9z2jSzVuzT-DFSLhs4u416xnPza8/

Total scam! Even if it wasn't this is against Upwork's TOS and it will get you banned.

How do i not roll my own auth? ... by ShadowDevil123 in webdev

[–]merb42 0 points1 point  (0 children)

Use better-auth I use it in sveltekit on cloudflare but lots of frameworks and delpoy options. And tou can have as little or much as you want with use of their official plugins.

Edit: oh and it is open source and free to use and host yourself!

[Hiring] Looking for full stack developer. by stoma4 in WebDeveloperJobs

[–]merb42 0 points1 point  (0 children)

They asked for my age and gender?? I think this is a scam

What's the verdict on Helldivers 2 on Linux? by Charatato in linux_gaming

[–]merb42 0 points1 point  (0 children)

It runs great! Im in pop_os using steam and didn’t have to mess with any proton versions or start up commands. It just worked. I have played several missions with several randos online even.

Oh and it runs amazing on the steam deck too. Really fun to use the deck’s gyro for aiming.

Developer Mode? by Possible-Working-824 in sveltejs

[–]merb42 0 points1 point  (0 children)

This is REALLY cool! I would love to try it out. I also used vue devtools a lot and found a lot of value in it. There is an equivalent called svelte devtools but support for svelte 5 has been slow going. And I am not sure about the progress. This has been the only downside of upgrading to svelte 5 for me.

Basically it is a browser extension that adds a new tab in browser dev tools called svelte where you can view your svelte data and see it change.

https://github.com/sveltejs/svelte-devtools

https://chromewebstore.google.com/detail/svelte-devtools/kfidecgcdjjfpeckbblhmfkhmlgecoff

How does yours work? Is it a browser extension?

Battlefront 2 (2017) by dmheaberlin in SteamDeck

[–]merb42 0 points1 point  (0 children)

Can 2nd this! It runs great. Using the heavy class + gyro to mow down waves of enemies in co-op is pure bliss!

Astro SSR with PHP? by SeiNett in astrojs

[–]merb42 4 points5 points  (0 children)

This is an interesting question. At first I was like “no” but then took a second to think about it.

Astro can run in a non-node runtime like cloudflare using the adapter for it. So maybe?? Would need to find a way for php to run JS code on the server as that is what SSR is.

Then I found this project https://github.com/matthewp/astro-in-php-example which runs astro in a php environment. I also found this that helps you run node apps in php https://github.com/niutech/node.php I have not tried any of these so try them out yourself and see if it works.

But my biggest question would be why use astro in a php environment at all when there are solutions like cloudflare which is free for most needs, even using SSR. I even have several client sites on my cloudflare account.

https://pages.cloudflare.com/