HN user

djxfade

854 karma
Posts13
Comments281
View on HN
Deno Desktop 1 month ago

This is pretty much what Tauri solves. It re-uses the systems WebView. So the built apps are tiny (kb to a few mb)

PHP 8.5 8 months ago

This.

One common use case for the @ operator, is when "destructuring" array members into variables. In some cases, you can't know if the member will be available, but it's not important if it's missing. In that case, you can silence the warning.

$array = ['apple', 'pear']; @list($mainFruit, $secondaryFruit, $tertiaryFruit);

Since I suppress the warning that would occur due to the third member not being present, the program will continue executing instead of halting.

It was implemented in some of the earlier Leopard beta's iirc. Possible speculation from my side, but it was probably removed due to licensing once Oracle expressed interest in acquiring Sun Microsystems.

As a side note, I personally HATE apps that opens links in an in-app web view (apps like Instagram, Facebook, etc). I really wish Apple could have a system wide preference where it could force in-app web views to open in the browser.

That's not totally correct. PHP has a "short function" syntax for that specific use case, it automatically captures data without the 'use' statement.

    $a = 5;
    $b = fn ($c) => $a * $b;
    print($b(2)); // 10
    print($b(4)); // 20

Very cool! How does this work from a technical standpoint? Do you have to implement a full HTML/CSS renderer in JS, or is there an official browser API to capture the elements as image data?

KidPix 2 years ago

It's possible to avoid this issue. I implemented a Canvas based clone of the classic MS Paint back in the days. One of the tricks to avoid this, was to use decimal pixel coordinates, so instead of drawing a pixel at (100, 200), you would draw at (100.5, 200.5).