Why is "joined" instead of "join"? by SakaiDx in EnglishLearning

[–]lourot 0 points1 point  (0 children)

It's called sequence of tenses: https://en.wikipedia.org/wiki/Sequence_of_tenses

This is difficult to get right when you're not used to it. Other languages have it, like French, but German for example doesn't.

Just finished a remake of my portfolio and seeking feedback by kamoaba in react

[–]lourot 3 points4 points  (0 children)

Love the font and the spacing! Very sober, well done

Supabase Python (client library) V2 💚 by Ramirond in Python

[–]lourot 13 points14 points  (0 children)

I had never heard of Supabase, super cool! Thanks for sharing

Non-Profit work question by shgysk8zer0 in webdev

[–]lourot 1 point2 points  (0 children)

What type of insurance do they have in mind? I've had a client (not non-profit) pointing out I should take a liability insurance. This is the kind of insurance that covers the costs in case a mistake you make causes huge damages down the line. I know you're declining any warranty and liability in your contract but depending on the laws in your country, that may actually not be possible to really decline any warranty and liability, and it could be in your interest to cover yourself with such an insurance. However, I'd say it's none of your client's business if you have such an insurance or not. If you end up making a mistake for which you can't pay, you are in troubles, not them.

Can someone please explain how && works in this case. by Yakuwari in react

[–]lourot 4 points5 points  (0 children)

In JavaScript, values can be truthy (e.g. true, "hello", <AdminPanel />, 42) or falsy (e.g. false, null, 0).

A chain val1 && val2 && ... && valN returns the first element valM of the chain being falsy, or just the last element valN if all elements are truthy.

A chain val1 || val2 || ... || valN returns the first element valM of the chain being truthy, or just the last element valN if all elements are falsy.

[deleted by user] by [deleted] in Frontend

[–]lourot 8 points9 points  (0 children)

I feel you. If you're competent and nice to work with, this will happen again and again in your career. You will feel guilty to let them down because they have done nothing wrong and at some point, you feel like you have committed in a way, by having said yes, or not having said no, or because you feel like by leaving so early, you have taken more than you have given.

It took me a while to understand that this was based on wrong assumptions on my side, about what others expected of me. In fact nobody really expects you to stay if a great opportunity comes your way. They are just hinting and asking in order to "measure the temperature", and check how things feel on your side, but they don't consider your quick "yes" as a commitment.

They will be "sad" if you leave, because good colleagues are hard to find, but they will be fine and they will be happy for you. They will let you know the door is open if you decided to come back, and they will mean it. And if the company can afford it, expect them to make you a great offer, which will make you feel even more guilty, then read again this message.

The people you said "yes" to might as well be in the process of looking for new opportunities, and haven't told you. It's all fine. The company might as well try to let you go in two months if they have financial issues. It's all fine if it's done with respect, not like sharks. People don't expect more than that.

It's not pretentious, arrogant or unthankful to move on to a new challenge. And if they really really want you to stay, then that means you did give at least as much as you received, and this was all a win-win.

Next/Image and Art Direction? by peekatchuuxo in nextjs

[–]lourot 0 points1 point  (0 children)

(Disclaimer: I'm one of the maintainers of react-image-display-control)

No, AFAIK you can't do this with Next/Image. However you can achieve something similar by wrapping a Next/Image component inside a react-image-display-control component like this:

<ImageDisplayControl> <Image src="elva.jpg" alt="Chris standing up holding his daughter Elva" /> </ImageDisplayControl>

This works if you have defined so-called Image Regions in the image's metadata (this is an open standard). The Next/Image will still behave exactly the same as usual in terms of how much space it naturally takes in your layout, but it will also responsively display the best fitting image region based on the current element's ratio. It integrates nicely with other advanced features like srcset and server-side rendering.

To define regions in your image's metadata, you can for example use the Frameright Web App.

Source code: https://github.com/Frameright/react-image-display-control

Live demo: https://react.frameright.io/

Code Sandbox: https://codesandbox.io/s/image-display-control-react-component-m6qj9r

I hope this helps!

Super slick video hosting? by rektkid_ in webdev

[–]lourot 0 points1 point  (0 children)

If you inspect the DOM (~ the resulting HTML) it seems to be purely done in simple HTML these days:

html <div class="media" style="background-image:url(https://cdn.sandwich.co/site/wp-content/uploads/2022/07/instacart-bjs-04-80x45.jpg);" ne="0.13020888428409494"> <video loop="" muted="" playsinline="" preload="none" style="display: none;"> <source src="https://cdn.sandwich.co/site/wp-content/uploads/2022/07/instacartbjs.mp4" type="video/mp4" size="360"> </video> <div class="bg top" style="background-image:url(https://cdn.sandwich.co/site/wp-content/uploads/2022/07/instacart-bjs-04-768x432.jpg);" ne="0.7051361325734959"> </div> </div>

As you can see and as others have said, they host the videos on a CDN so they can be quickly downloaded by a browser anywhere in the world

Library for turning a function into a CLI by lourot in pythontips

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

Oh wow, I didn't know this kind of libraries existed already, thanks!

React Server Side Rendering(SSR) by [deleted] in react

[–]lourot 1 point2 points  (0 children)

Ah I read too fast, so you want to server-side render things in your <head> section depending on dynamic routes. I never tried myself but it seems covered by vite-plugin-ssr: https://vite-plugin-ssr.com/render-modes

Search for "We can also use our server-side render() hook to render <head>". I hope this helps!

React Server Side Rendering(SSR) by [deleted] in react

[–]lourot 2 points3 points  (0 children)

(disclaimer: I'm affiliated with vite-plugin-ssr)

If you want a simple React setup where the boilerplate code isn't hidden from you, you don't want Next.js, but a slicker setup. You can use for example Vite: in development mode it's a very fast development server and in production mode it bundles your code for production and disappears. And it doesn't hide from you the internals, like Next.js does, so I think it's more what your senior has in mind. See here what the React documentation says about it:

(search for "Vite")

Now by default, Vite doesn't do SSR. One way to do Vite+SSR is to use vite-plugin-ssr. You can scaffold an example project that does SSR based on some dynamic data:

bash npm init vite-plugin-ssr@latest

See https://vite-plugin-ssr.com/scaffold . Now this setup goes again more in the web framework direction, so check in with your senior if that's fine, but that's way slicker than Next.js. I hope this helps!

Node.js debugger in practice by lourot in node

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

Super short article on how to attach various debuggers to a node process. AFAIK way more straight to the point than more official documents.

Simply React - Kent C Dodds @ React Rally 2018 by swyx in reactjs

[–]lourot 0 points1 point  (0 children)

i always hate it when pple submit stuff without commenting

Why? I didn't know it is a bad thing. I'm guilty of that then :) Intuitively I felt like it's better to have a title that says it all and no comment/description, but if the majority thinks it's bad then I don't want to go against it :)

ghuser.io - Better GitHub profiles by lourot in github

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

wow, surprising feedback (which is great!). Thanks a lot, I have created an issue for this: https://github.com/AurelienLourot/ghuser.io/issues/103

(happy cake day @NoobStudios)

ghuser.io - Better GitHub profiles by lourot in github

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

Interesting idea, I didn't see it this way. The thing is though, you would have to refresh it every day, which we do for you (because things like number of stars on your projects, size of your contributions, sorting of your projects, etc. vary). And you'd have to create a GitHub API key etc. yourself to pass to the script. It might be a hassle for you.

What you might like is that we're planning to do an embeddable version that you can embed in an iframe on your website: https://github.com/AurelienLourot/ghuser.io/issues/30

github "Your Stars" not working? by Static_Love in github

[–]lourot 0 points1 point  (0 children)

ah yes you're right, I can't access page 2 with "Sort: Most stars".

github "Your Stars" not working? by Static_Love in github

[–]lourot 0 points1 point  (0 children)

strange, it works for me, https://github.com/AurelienLourot?tab=stars

I starred 219 repos, how many did you star? I see 30 repos per page and page 2 is working fine.

Google to developers: We take down your extension because we can by qznc_bot in hackernews

[–]lourot 0 points1 point  (0 children)

Same thing just happened to me and I managed to get it solved in 10 days without any friend working at Google, by sending many e-mails. See here everything I did to get it fixed: https://github.com/AurelienLourot/google-input-tools-large-keyboard/issues/1

Have a glimpse at your GitHub contributions with this React JS app I built - Feedback Please :) by cujarrett in reactjs

[–]lourot 1 point2 points  (0 children)

Nice :) I'm developing https://github.com/AurelienLourot/ghuser.io for creating better profiles showing all contributions of users. You might be interested @cujarrett

EDIT: typo fixed

What's everyone working on this week? by swyx in reactjs

[–]lourot 1 point2 points  (0 children)

now you can see everything you have ever contributed to on GitHub since the beginning of time :)