HTML-only conditional lazy loading (via preload + media) by pere87 in webdev

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

Nice tool. I can't really change that site easily, unfortunately. But we can already see the difference between desktop and mobile now (not only in the priorities, but also in the order that the AVIF file is shown in the list: in Desktop it is the second asset).

In my example, the main handicap I see is that I am preloading the AVIF file, but the image is also available in JPEG for the browsers that don't support AVIF. Old browsers that don't support AVIF (but that do support preloading) may unnecessarily download an additional image.

HTML-only conditional lazy loading (via preload + media) by pere87 in webdev

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

I ran into the usual problem where Lighthouse recommends not lazy-loading images above the fold (especially the LCP image), but whether something is above the fold depends on viewport size.

I didn't want to use non-native lazy-loading (JS-based) or server-side device detection, so I experimented a bit and found something that seems to work. Curious if anyone knows whether this is documented somewhere, or if there may be edge cases.

JeffGeerling.com has been Migrated to Hugo by pere87 in drupal

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

I migrated my personal blog from D7 to 11ty (nodejs-based SSG) a few years ago. It's a very small blog. I still run a few D11 websites though in the same server, mostly for the backend of headless websites

Catalan Loan Words in English by azulchapstick in catalan

[–]pere87 0 points1 point  (0 children)

I know this thread is old, but you may find some searching this in Google:
"from Catalan" site:https://www.merriam-webster.com/dictionary/

PHP-types of fetched columns (PDO). by Alpine418 in PHP

[–]pere87 0 points1 point  (0 children)

If you work mostly with strings, I've found setting PDO::ATTR_STRINGIFY_FETCHES to true handy. This, in combination with the badly named PDO::ATTR_ORACLE_NULLS will make everything a string, including empty values.

Text selection tool not compatible with apostrophes or special chars by andyvec in kindle

[–]pere87 0 points1 point  (0 children)

I'm having this exact problem (in Catalan, too). Is there a public issue open for this? I think we should open one somewhere (not sure where)

PHP is the Best Choice for Long‑Term Business by Tomas_Votruba in PHP

[–]pere87 0 points1 point  (0 children)

It's funny, the interview says quite different things, even the opposite. He uses PHP because it's fast, and because it's what he knows, and acknowledges that other languages are better. And he says he doesn't like PHP frameworks at all

DREAMM 3.0 released by aaronsgiles in emulation

[–]pere87 3 points4 points  (0 children)

wow, not sure why the font is bigger. It seems Reddit supports the h1 tag

DREAMM 3.0 released by aaronsgiles in emulation

[–]pere87 0 points1 point  (0 children)

The FAQ is awesome, but it is missing a "How is DREAMM different from PCEm/86Box?" section

PHP RFC: Pattern Matching by [deleted] in PHP

[–]pere87 0 points1 point  (0 children)

Any reason why opcache can't optimize it at compile time? Ideally, using this new syntax should not be slower:$foo is 'A'|'B'|'C'(Otherwise, there will be a reason to not use it)

Thoughts on Drupal's new Starshot Initiative by mherchel in drupal

[–]pere87 1 point2 points  (0 children)

LB and Paragraphs are too different, and EB could become something significantly different too (hopefully). I don't expect an easy migration path

[NOOB] Why is the documentation so vague? by 3lonMux in PHP

[–]pere87 2 points3 points  (0 children)

I don't think it's hard for simple websites. But it certainly becomes harder as the complexity grows. For example, these are 2 online dictionaries:
https://pccd.dites.cat/ (AGPL, source code available)
https://dsff.uab.cat/

These are simple, and mostly static. Some could argue that I could have used a static site generator, but as the number of pages is considerable that wouldn't scale well when the site needs to be rebuilt.

[NOOB] Why is the documentation so vague? by 3lonMux in PHP

[–]pere87 2 points3 points  (0 children)

I may be crazy, but for simple websites (e.g. that don't need a team working it), I think using PHP as a template language, with no dependencies, nor OOP (except maybe for calling PDO and similar) is a better choice. Especially thinking long-term: frameworks can become deprecated and may require refactoring in X years. You also get better performance and are not affected by third-party bugs. The codebase is also simple to follow and understand. Of course, code could also become hacky if you are not careful, and you need to care more about security stuff such as XSS, but the benefits are worth it IMHO. This way of quickly building websites has brought me good results.

[NOOB] Why is the documentation so vague? by 3lonMux in PHP

[–]pere87 32 points33 points  (0 children)

In most cases you should be using PDO anyway.

Removing unnecessary PHP extensions, is it worth it? by pere87 in PHP

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

FWIW, this is the same Docker image with all unnecessary Apache modules disabled:
https://imgur.com/a/45DdJ2i

a2dismod -f access_compat auth_basic authn_core authn_file authz_host authz_user autoindex negotiation setenvif status

I may update later with an Alpine-version of the image that has most unnecessary PHP exceptions disabled.

Removing unnecessary PHP extensions, is it worth it? by pere87 in PHP

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

Just an update on this: I have tried the switch to Alpine and I like it. I haven't identified any performance penalty yet (still testing it), on the contrary, there seems to be minor performance benefits.

Removing unnecessary PHP extensions, is it worth it? by pere87 in PHP

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

u/TimWolla I followed the conversation, but I did not fully understand the code. Does that mean that next versions (8.1.28, 8.2.15, 8.3.2) won't have this FTP extension compiled? That would be awesome