Tag Web Development

At last no more FART Chrome 93+

For those who like to implement both light and dark themes and want to do that in the most optimized way I have good news for you Google Recently implemented in Chrome > 93 the ability to get the user preference using server-side technologies.

Why is that important? Because just in case you didn't hear the term FART by now it stands for "Flash of inAccurate coloR Theme", the main issue is that if you don't know the user preference before sending a response to a request, you can optimally se...

View full article

Don't include external JS for custom content example Goodreads

On many websites, you can have content embedded from other sites and one way that most external sites will offer will be to include a script that's hosted on their website.

But if all that script does is including some remote content there are better ways to get that, that will provide customizations and performance.

For example, the website Goodreads offers such an embed JS with a list of the latest books you read, and you must include the script where you want the content to be shown. But t...

View full article

Build a Simple WordPress commenting system on top of the native one with AMP support

There are a lot of commenting system plugins out there but most of them come with a cost, and sometimes just building a simple WordPress commenting system on top of the native commenting system can be enough.

The main features of this system will be:

  • Comments will be only loaded if the user clicks a button
  • Comments will be submitted and fetched by JS
  • Comments will have paginations fetched by JS
  • Comments will have some JS interactivity
  • Comments will have the reply feature enabled
  • The comment system...
View full article

Async Task without Queue or E-loop PHP

Most react-PHP code I've seen in the open that is not extension-based (doesn't extend the PHP core language) uses some kind Event-Loop, something similar to how many technologies or languages(I.e. JavaScript) implement concurrency that doesn't support threads.

And historically on single-core CPU's threads practically transformed into loops underneath. But the main idea is that in many languages, an async behavior is very easily achieved, maybe you need a keyword, maybe you need a special class,...

View full article