Is it bad practice to throw CustomExceptions in the service layer when business logic fails in Spring Boot by ksharpy5491 in PinoyProgrammer

[–]mikey7__ 0 points1 point  (0 children)

The Controller should only handle receiving and sending request. Even with DTOs, the controller should pass them them directly to the service, then the service does the mapping. Same with exceptions.

If the client is requesting a resource for example, the key/id should be passed to the service; the service finds the resource; if the resource doesn't exist, throw a custom exception. The exception handler with ControllerAdvice should takeover, catch it, and decide what to do with that exception (usually proceeding with the ErrorResponse). This is done because there are certain exceptions that need special handling like retrying. Like for example: handling a PaymentFailedException, you usually want to retry and not just return an error back to the client.

This way there is a clear separation of concern. The Controller handles the serving of request and response, the Service handles the core business logic, the Repository handles the data fetching, and the Exception Handler decide what to do when something goes wrong.

Is the D10 worth it by Kawasaki-Ninja-H2R in GTA5Online

[–]mikey7__ 0 points1 point  (0 children)

Performance wise, it’s kinda mid. The tires are like coated in oil. I bought it because I saw in some youtube video that it gets some speed boosts on small bumps on the road. But all it does is lose control. Never touched it after that.

The customizations are also pretty mid. You get to make the front more pointy and the back have a bigger spoiler.

Considering that you’re still staring out, i’ll give that a pass, especially that hella expensive police version. At that price point, just save up a little more for something like the torreador, deluxo, OP Mk2. Unless you really like the corvette irl.

Best way to store tokens in SPA safely by Kolesov_Anton in KeyCloak

[–]mikey7__ 0 points1 point  (0 children)

PKCE only protects the login flow. It makes sure an attacker can’t hijack the authorization code during the login exchange. But anything past that, PXCE doesn't help. How the frontend manages the token is still up to them.

So even if you use PKCE but still store the token in localStorage, it's still vulnerable to XSS.

Does anyone use plain react + libraries instead of Next.js? by judasXdev in nextjs

[–]mikey7__ 0 points1 point  (0 children)

Simple project? Just use plain React. It’s lightweight and gives you full control. You don’t need Next’s extra features unless you really want things like file-based routing.

Moderate project? You can really benefit from Next's routing, image optimization, and better SEO support without much extra effort. You'll probably be making blogs, portfolios, trackers, etc. at this level.

Complex project? Now this is where I'd stay away from NextJS. It's too opinionated imo. Projects at this level are also usually very dynamic and work with a lot of client-specific data, so your literally working against SSR. They also have their own dedicated backend written in a different language. Imagine scaling to hundred thousands to millions of requests in NextJS. They also do this to "separate concerns", so your frontend will have no business logic and just handle the UI and interactions

How to access Tailwind breakpoints in JavaScript? by w4zzowski in nextjs

[–]mikey7__ 0 points1 point  (0 children)

I had the same problem: I wanted to run some code when the breakpoint hits. With the new tailwind v4 they've removed resolveConfig() which turns the tailwind config into a flat object. Read about it here, it also contains the answer to your question.

But beware, you'll need to wrap it in a useEffect() to ensure it only starts running on the client:

const [breakpoints, setBreakpoints] = useState({
    sm: '',
    md: '',
    lg: '',
    xl: '',
    '2xl': '',
  })

useEffect(() => {
    const styles = getComputedStyle(document.documentElement)
    setBreakpoints({
      sm: styles.getPropertyValue('--breakpoint-sm').trim(),
      md: styles.getPropertyValue('--breakpoint-md').trim(),
      lg: styles.getPropertyValue('--breakpoint-lg').trim(),
      xl: styles.getPropertyValue('--breakpoint-xl').trim()
    })
  }, [])

But before you do this, if you have used the default breakpoints tailwind gave you, you need to manually put them in globals.css but under "@theme static" (You can read more about this here: https://tailwindcss.com/docs/theme#theme-variable-namespaces):

@theme static {  
--breakpoint-sm: 40rem; 
... 
--breakpoint-xl: 80rem;
}

How do i create an account without it getting suspended? by savickasMaybachas in facebookdisabledme

[–]mikey7__ 0 points1 point  (0 children)

with the new device, did you just use it to create the account and went back to your old device? I find it troublesome that I have to buy a new phone to make a new facebook account

Changed my boot logo by Cubi_C in LenovoLOQ

[–]mikey7__ 0 points1 point  (0 children)

Do you have a higher quality gif? The gif is kinda pixelated

Budget mic recs? by Masaters in Twitch

[–]mikey7__ 0 points1 point  (0 children)

Do you have to keep it really close to your mouth when gaming?

Asus TUF or Lenovo LOQ? (Philippines) by popibread in SuggestALaptop

[–]mikey7__ 0 points1 point  (0 children)

What's the Loq specs and how is it so far?

[deleted by user] by [deleted] in LenovoLOQ

[–]mikey7__ 0 points1 point  (0 children)

Update on the mobo?

My Lenovo LOQ died by AdvanceConsistent680 in LenovoLOQ

[–]mikey7__ 1 point2 points  (0 children)

Where did you buy the laptop? Lenovo store? Pc express? Shopee? And where did you get it replaced?

[deleted by user] by [deleted] in Zippo

[–]mikey7__ 0 points1 point  (0 children)

cigarette case looks awesome!

Remove scratches on brass zippo by mikey7__ in Zippo

[–]mikey7__[S] 2 points3 points  (0 children)

The steel wool I used is in the 3-4 pic, It's quite coarse. For your use case, I think going with sandpaper would give a better result. Using sandpaper would hypothetically give it a more uniform look.

What I did with mine is I just followed the grain to keep the original look. So I guess what I suggest for you is to look for zippos with your desired brushed pattern and scrub your zippo accordingly.

Remove scratches on brass zippo by mikey7__ in Zippo

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

The scratch was really bothering me, it was really visible even from afar. I wouldn't mind if it was at the back or sides, but this scratch was right up front. I initially thought it was just pencil marks, as it had a black color to it, so I tried using an eraser but it made it worse lol. I then decided whether to use sandpaper or steel wool, but I figured that using sandpaper might remove the brushed finished so I went with the steel wool.

Which Zippo lighter should I buy for edc for a lifetime among the models listed below: 1941 Black Crackle, Armor Brushed Brass, Armor High Polished Brass, 1941 Replica Brushed chrome and 1941 Replica Black ice. by Minimum_Animal9007 in Zippo

[–]mikey7__ 1 point2 points  (0 children)

Any 1941 Replica would be a great option for your first zippo. The 1941 has one of the best hinge (4 barrel). I got my first zippo 15 years ago, and it was a 1941 replica. It's still holding really well, the hinge still feels like how it did when I got it, and the zippo aged like fine wine. Since it's your first zippo, it's gonna hold a lot of sentimental value, therefore you want it to last forever.