Introducing PHPSandbox Play | implenton

I have been using CodePen, CodeSandbox, and similar services to try out things or throw together a prototype. While these are great for JS, CSS, and HTML, they can't run PHP.

3v4l is excellent for teeny code snippets, but it's not really for prototyping; its selling point is that it can run more than 250 PHP versions.

The good news is... PHPSandbox just launched Play that

is a playground to try Composer packages. With it, you can try 350k+ packages using a standard PHP v8.1 environment.

Exciting.

Trigger a GitHub action with repository_dispatch | implenton

Have you ever wanted or just wondered if running a GitHub Action workflow is possible by essentially hitting a webhook?

Yes, it is! Create a repository dispatch event and make sure the workflow yaml has the repository_dispatch.

Once you have this set up:

on:
repository_dispatch:
types: [on-something-happened]

Do this:

curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/repos/OWNER/REPO/dispatches \
-d '{"event_type":"on-something-happened"}'

Metasyntactic variables | implenton

What comes after foo, bar, baz? How do you continue the sequence?

One way to continue this list of metasyntactic variables is with qux, quux, corge.

A metasyntactic variable is a specific word or set of words identified as a placeholder in computer science and specifically computer programming.

Prettier plugin to sort imports | implenton

Almost never (really) matters in which order you import stuff in JavaScript. But, like many, I still prefer to follow a convention.

If you are already using Prettier, you can use the plugin sort imports plugin.

A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order.

Guerrilla SMTPd and PHP SMTP servers | implenton

Ever since I took a look at the implementation of Kill the Newsletter! I have been thinking of recreating it with PHP.

Guerrilla Mail before switching to Go were using an SMTP server implemented in PHP called Guerrilla SMTPd.

The purpose of this daemon is to grab the email, save it to the database and disconnect as quickly as possible.

Maybe this could serve as an inspiration, as the code is quite old, and I'm not even sure if it's running on PHP 8.1. I think a modern take on Guerrilla SMTPd could easily lead to the world of async PHP, Swoole, Fibers, ReactPHP, etc.

The other projects I found looked half-baked or claimed questionable things.

XSLT to transform XML to HTML | implenton

I came across XSLT when I was searching for ways to style RSS feeds with CSS. Now that I put some things into practice, XSLT is even more mind-blowing.

XSLT (Extensible Stylesheet Language Transformations) is a language originally designed for transforming XML documents into other XML documents, or other formats such as HTML.

Take a look at the example to see how an XML structure is transformed into another one or HTML.

I thought such things were possible only with PHP, JS, or your go-to programming language.

CSS has pseudo-class revolution | implenton

There are countless articles about the :has pseudo-class lately, and more will come.

We are months or not weeks away from seeing all major browser support it. For me, this is the most exciting thing that happened to CSS in years.

As always, as the Using :has() as a CSS Parent Selector and much more article puts it:

The hardest part of :has will be opening our minds to its possibilities. We’ve become so used to the limits imposed on us by not having a parent selector. Now, we have to break those habits.

Systems.css, design system for building retro Apple interfaces | implenton

System.css is a CSS library for building interfaces that resemble Apple's System OS which ran from 1984-1991

As mentioned on the page, there's also 98.css, which inspired this project.

I like some elements, especially the scrollbars and title bars. I can imagine a few design details added to this site in the future and taking the overall look into a more retro direction.

YAML and the Norway problem | implenton

As a curiosity...

When it comes to booleans, in YAML you can use y, YES, on, True and other variations for the true value.

As you probably guessed, for the false value, you can use n, NO, off, etc.

But NO is also Norway's ISO 3166-1 alpha-2 country code. Oops. Edge case.

Of course, you can just escape it, as this article rightfully suggests.

Style your RSS Feed with CSS | implenton

When you open an RSS feed, you usually see the raw, unstyled XML structure and nothing more.

But it doesn't have to be this way. CSS can be used to style the RSS feed.

If the RSS is nicely styled, it might even be "redundant" to provide a "website" version. Think of personal microblogs where mostly only friends follow you.

It's something worth experimenting with.