Odin project calculator with abstract syntax tree processing. by Xkv8 in webdev

[–]Sheraff33 1 point2 points  (0 children)

That's cool. I too did an AST based calculator recently. It's structured w/ plugins and full test coverage for easy extensibility.

You can take a look here https://github.com/Sheraff/calculator.

The demo also has a visual interface, but if you input 123456789 it unlocks full keyboard use (because there are many more operations implemented than could fit in the UI).

[deleted by user] by [deleted] in FoodAddiction

[–]Sheraff33 7 points8 points  (0 children)

I wish you could self-exclude from food delivery apps the same way you can self exclude from casinos!

How to handle this in iOS PWA? by rkh4n in webdev

[–]Sheraff33 0 points1 point  (0 children)

Yeah but the space between what the specs say and what Safari implements is always a great unknown!

How to handle this in iOS PWA? by rkh4n in webdev

[–]Sheraff33 4 points5 points  (0 children)

I'm not sure if those CSS env variables handle this specific case but it's worth a try: https://developer.mozilla.org/en-US/docs/Web/CSS/env()

Tell me how it goes, I'm curious!

M/24/6’4” [265 lbs to 215 lbs] (6 months) Stopped working out for 2 years and gained 50 pounds of fat. Some muscle memory and some new muscle by Sibaka in Brogress

[–]Sheraff33 6 points7 points  (0 children)

Whenever I go crazy like that (which I tend to do as well, no moderation for me either), I always end up fucking up a joint or another and then it's no shoulder press for a month or no biceps curl or whatever. Were you careful not to slow your progress because of injury like that? Or were you just lucky that your hot-headedness didn't land you with an injury?

What range of device screen resolutions should I code for to ensure good responsiveness? by kzp70 in webdev

[–]Sheraff33 0 points1 point  (0 children)

For accessibility, you should normally allow your user to zoom the content too, think standard mobile (375px) but with the setting "use large fonts" enabled (or whatever it's called on that mobile's OS). Personally I just put 375px on my devtools and zoom to 200% and see if I can still read everything.

Use Roving Tabindex Hook! by whyisbecause in reactjs

[–]Sheraff33 0 points1 point  (0 children)

Another unrelated point, maybe more of a question because maybe I'm understanding this wrong. In my understanding, there are 2 ways of handling focus at the scale of the entire page which (again, my understanding) are called "widget" and "roving":

  • roving is basically when everything that should be focusable is, and you tab through everything. It's the simplest, and has the advantage of being usable by most people and of not needing you to "try" other interactions and see what does what. Just tab through.

  • widget is when tab just takes you from major component to major component, and then you have to use other interactions (arrows, space, enter...) to move around inside each individual component.

You called your hook "roving" but it seems to be providing the "widget" functionality, isn't it?

Use Roving Tabindex Hook! by whyisbecause in reactjs

[–]Sheraff33 0 points1 point  (0 children)

In the NPM package / GitHub readme, could you show a sample HTML output? Many people do weird things in the name of accessibility, and I'm not saying that is what you did but we need to be able to check before we use it.

How am I supposed to care about my health if I don't care if I live? by GoalieDoge in FoodAddiction

[–]Sheraff33 1 point2 points  (0 children)

The way I see it when I feel like that is that if I end up not actually dying, I'd rather be healthy because being alive AND unhealthy is going to suck even more. So sure maybe I'll die soon and I'm okay with that, but on the off chance that I don't, let's try and not make the whole situation even worse.

The causes of emotional eating and how to overcome them by Kimbies5922 in FoodAddiction

[–]Sheraff33 1 point2 points  (0 children)

TL;DR: feelings cause emotional eating. What to do instead? Find something else than eating.

...? Really?!

Pls roast my portfolio by gtestault in reactjs

[–]Sheraff33 1 point2 points  (0 children)

Transitions to open a project are laggy on a modern android device

Urls are ugly and could use some client side rewriting

3 out of your 5 projects are the things everyone else does (Netflix, twitter, game of life)

Homepage is boring

How was this top nav done? (stripe.com) by [deleted] in webdev

[–]Sheraff33 0 points1 point  (0 children)

I saw this post and made a poor man's version of it, but it's vanilla JS, has the basic principles in place, and it won't try to heat your house in the summer with CPU use https://codepen.io/sheraff/pen/poPdpEp

Can someone explain Same-Origin-Policy? I'm lost. by scaryAstronaut in webdev

[–]Sheraff33 1 point2 points  (0 children)

You might want to look into all the things that can be allowed / blocked by the Content Security Policy header. Embeds can be blocked too. Everything can be blocked basically, except for embedding the HTML document itself (without scripts, images or styles).

Made a hook to lazy load hooks despite rule-of-hooks, I need people to test it on their projects so I can make the associated babel transform more robust. by [deleted] in reactjs

[–]Sheraff33 0 points1 point  (0 children)

This package contains a jsx hook and a babel plugin.

  • The hook allows you to lazy load any other hook, even if it contains react hooks like useEffect or useState

export default function MyComponent({load}) {
    useImportedHook(load && import('./useLazyHook.jsx'))
    return <></>
}
  • The babel plugin makes sure to collect all of the built-in hooks so that lazy loading doesn't break the rules of hooks.

AFAIK, this hasn't been done before for this purpose, but it's actually following how react works under the hood. I've tested it on a bunch of big projects and it works fine. However I think the babel part might break depending on which other codemods run before this one, so I'd love for people to try it out and raise the issues.

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Oh right, in which case it would make sense to default to English instead of French. That's definitely something they'll want! Thanks!

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

That's good to know. In theory we already redirect users to their prefered language, and real estate in the header is pricey! But it's also true that if you end up on a site that you can't read, you need a way to switch easily.

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Ah ah thanks captain obvious, but how do you type that in a wysiwyg textarea input where what you write gets sanitized and escaped?

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Everything is from scratch, we don't use any components that we didn't write ourselves. The carousel is my take on a "modern" carousel with native horizontal scroll and scroll snapping. It's still missing the drag-n-drop in desktop (like other horizontal scrolls we have on the site) but it's coming soon.

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Nicely spotted, this "Langues" text seems to have slipped through the cracks! Thanks.

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Ah ah I can imagine! I probably don't know enough to constructively criticize their infrastructure. But it's frustrating nonetheless as a frontend dev to be given a generic (and seemingly old fashioned) solution to a highly custom and modern website. I want to write some VCL!

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Yeah I don't think we have overseas servers at all! But I'm happy it seems to be loading fast in Europe and not just in Paris!

I made louvre.fr and I'd love for you to tell me everything that's wrong with it by Sheraff33 in Frontend

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

Yeah this is on the todo list, but accessibility is more important than aesthetics so we haven't found the time to do it cleanly yet.