HNHacker News
TopNewBestAskShowJobs

palsecam

1,001 karma · joined February 7, 2008

https://paul.fragara.com/
submissionscomments
palsecam··on 418 I’m a teapot
444 is a (nginx-specific) idea too, indeed.

Blocking at the edge (on the CDN) is another, and it would be even quicker ;-) (I use Cloudflare, a Cloudflare worker could be set to answer /wp-login.php or anything, without even reaching my own server.)

Wrt. how to ban: an option would be something like fail2ban (https://en.wikipedia.org/wiki/Fail2ban)

palsecam··on 418 I’m a teapot
Wow, thanks jbombadil! That’s so heart-warming to hear <3 I’m speechless. I’m glad you like https://FreeSolitaire.win that much! Thank you again for your kind words (and donation!)
palsecam··on 418 I’m a teapot
I use 418 as a reply to illegitimate bots. It’s fun and it makes filtering logs easier.

Nginx config snippet:

  # Nothing to hack around here, I’m just a teapot:
  location ~* \.(?:php|aspx?|jsp|dll|sql|bak)$ { 
      return 418; 
  }
  error_page 418 /418.html;
Example: https://FreeSolitaire.win/wp-login.php (NB: /wp-login.php is WordPress login URL, and it’s commonly blindly requested by bots searching for weak WordPress installs.)
palsecam··on WebP: The WebPage Compression Format
To have FreeSolitaire.win homepage be only 20.7 kB over the wire.

That’s for the whole game: graphics are inline SVGs, JS & CSS are embedded in <script> and <style> elements.

palsecam··on The "email is authentication" pattern
https://www.laPoste.fr/digiposte (digital safe) & https://laPoste.net/accueil (e-mail); offered by the postal services.

https://FranceConnect.gouv.fr/ is the online auth provided by the administration.

palsecam··on WebP: The WebPage Compression Format
`<!doctype html>` can be minified into `<!doctypehtml>`.

It’s, strictly speaking, invalid HTML, but it still successfully triggers standards mode.

See https://GitHub.com/kangax/html-minifier/pull/970 / https://HTML.spec.WHATWG.org/multipage/parsing.html#parse-er...

(I too use that trick on https://FreeSolitaire.win)

palsecam··on Ask HN: Who has had a successful PWA product?
OK, finally found a fix:

  /*
    Work around Firefox Mobile getting the hit target (clickable area)
    of the game control buttons wrong, when the (bottom) navigation bar
    gets hidden (when scrolling down).
    
    See https://bugzilla.mozilla.org/show_bug.cgi?id=1813213
    and https://stackoverflow.com/questions/70893056/mozilla-android-addressbar-conflict-with-sticky-button-on-bottom
    and https://news.ycombinator.com/item?id=40733062 ← thanks @ttymck for the bug report!
  */
  if (/Mobile.+Firefox/.test(navigator.userAgent)) {
    self.addEventListener('resize', frameThrottle1(() => {
      document.getElementById('metagame').style.position = (window.outerHeight > window.innerHeight)
        ? 'sticky'
        : 'fixed';
    }));
  }
palsecam··on Ask HN: Who has had a successful PWA product?
Thanks for the feedback!

I understand your will to disable vibrations. But thing is, right now I can’t think of how to offer that option properly. For instance, adding a Setting menu+icon just for that would be lame.

I’ll think about it more, tho.

palsecam··on Ask HN: Who has had a successful PWA product?
Oh thank you for that! Could reproduce that bug.

It’s because of https://bugzilla.mozilla.org/show_bug.cgi?id=1813213

I just spent a couple hours trying to find a clean workaround, without success… Will investigate more ASAP.

Thanks again!

palsecam··on Ask HN: Who has had a successful PWA product?
Thanks!

Word of mouth, mainly. Posted it on Reddit back then, things like that. It grew organically from that. And, although it’s far from being on top results on SERP (search engine result pages), some people do find it that way.

Also: because it’s so lightweight, it got included some years ago in the Moya app (https://play.google.com/store/apps/details?id=nu.bi.moya), a popular messaging app in South Africa that is “data-free” for users (it does reverse-billing). Now half the players are South Africans!

palsecam··on Ask HN: Who has had a successful PWA product?
There is also the “turn 3 by 3” mode! Please see https://news.ycombinator.com/item?id=40726628, just below in this thread.
palsecam··on Ask HN: Who has had a successful PWA product?
It basically is nothing more than a glorified shortcut. The installed app gets a custom load screen. It gets listed on the device installed apps list, and can be removed from there.

But there is nothing a PWA can do that a website can’t do. It’s all about Web APIs. Take push notifications (https://developer.mozilla.org/en-US/docs/Web/Progressive_web...): they make more sense for an (PW)app, but a simple website can do them too (if given permission).

See MDN intro on PWA: https://developer.mozilla.org/en-US/docs/Web/Progressive_web..., or https://web.dev/learn/pwa/ for more info.

palsecam··on Ask HN: Who has had a successful PWA product?
Oh, you can play in “draw 3 by 3” mode too: https://FreeSolitaire.win/turn-three ;-)

(You can also choose the mode in the New Game dialog.)

And yes, it’s indeed harder. The solving algorithm has a winning rate of 52% in “turn one” mode, but only 18% in “turn three”.

palsecam··on Ask HN: Who has had a successful PWA product?
Exactly.

“it’s just opening a browser window with no actual browser controls”: yes, due to the `display` setting in the app manifest: https://developer.mozilla.org/en-US/docs/Web/Manifest/displa...

It’s similar to a `WebView` component: https://en.wikipedia.org/wiki/WebView

palsecam··on Ask HN: Who has had a successful PWA product?
This.

Safari (and Firefox) does not have https://developer.mozilla.org/en-US/docs/Web/API/BeforeInsta... So you can’t have a custom button/way to prompt players to install.

However, they can install a PWA manually, by themselves; there is the option somewhere in their browser menu.

palsecam··on Ask HN: Who has had a successful PWA product?
Thanks!

The algorithm is described here: https://FreeSolitaire.win/strategy I came up with it by myself.

“The strategy presented here is the basis of the computer algorithm of FreeSolitaire.win, which is used to select finishable deals, offer hints, and detect dead-ends. You also see it surface when you are told that The computer could do it in N moves at the end of a game.

This strategy/algorithm is quite simple. It does not require to “count cards”, i.e. keep track of which cards were seen in the stock. It doesn’t require to make guesses on where such or such face-down card must be located. And the procedure is the same all along the game; there is no special treatement of the opening or ending. It’s stateless, a programmer would say. […]”

palsecam··on Ask HN: Who has had a successful PWA product?
AdSense.
palsecam··on Ask HN: Who has had a successful PWA product?
https://FreeSolitaire.win is a successful PWA of mine.

It’s a Klondike Solitaire game. It used to bring ~$500/mo of advertising revenue, but that’s significantly down these days: I refuse to have a cookie/consent banner, so I refuse customized ads (in the UE, in some US states now, &c.)

Players do add it to homescreen. There is a non-intrusive button prompting them to do so, at the end of a game. People like to be able to play offline. Apart from that, I don’t use much PWA/browser features; no notifications, etc.

More info here: https://news.ycombinator.com/item?id=34483398 Happy to answer any question you may have! Happy to get some feedback too ;-)

palsecam··on Microsoft's official Minesweeper app has ads, pay-to-win, and is hundreds of MBs
Thank you!
palsecam··on Microsoft's official Minesweeper app has ads, pay-to-win, and is hundreds of MBs
Oh, thanks a lot for such great feedback <3

About double-click on Win11: hmmm thanks, didn’t know about that. Will investigate as soon as I can put my hands on a Windows device.

About donations: great idea, indeed prompting with a fixed amount could be more performant.

palsecam··on Microsoft's official Minesweeper app has ads, pay-to-win, and is hundreds of MBs
A faithful remake of the good ol’ Minesweeper is at https://minesweepergame.de/

Since it’s a PWA, you can also install it.

It’s also open-source: https://github.com/phartenfeller/minesweeper_js

palsecam··on Microsoft's official Minesweeper app has ads, pay-to-win, and is hundreds of MBs
Self-plug: play on https://FreeSolitaire.win — no ads until game over. You can install it, it’s a PWA (Progressive Web App).

It’s also available in the Microsoft Store: https://www.microsoft.com/en-us/p/freesolitairewin/9p9s4fnp5... It was converted using https://pwa2uwp.fragara.com/

palsecam··on No-Bullshit Games
If you take installable Progressive Web Applications: https://FreeSolitaire.win
palsecam··on No-Bullshit Games
Nice little collection!

I suggested adding https://freesolitaire.win (minimal Klondike Solitaire game, self-plug) to the list, via the Google Form ;-)

palsecam··on Minify and Gzip (2022)
NB: there is also nginx `gzip_min_length` directive to avoid compressing small files https://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzi...
palsecam··on Using XPath in 2023
Yes, you can use `$x("//a/path")`, with (at least) Chrome & Firefox.

See https://devhints.io/xpath & https://devtoolstips.org/tips/en/evaluate-xpath/, and in this thread: https://news.ycombinator.com/item?id=36755041

palsecam··on Minify and Gzip (2022)
You’re right, however for offline but non npm workflow, you can also use the Closure Compiler JAR, grabbed for instance from Maven: https://mvnrepository.com/artifact/com.google.javascript/clo...

   $ wget https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/v20230502/closure-compiler-v20230502.jar
   […]
   $ java -jar closure-compiler-v20230502.jar 
   The compiler is waiting for input via stdin.
The Closure Compiler still is a Java project. It just gets primarily distributed via NPM these days.
palsecam··on Using XPath in 2023
I still use, to this day, XSLT on my website:

1/ To transform its Atom feed to pretty-looking HTML, if you access it from a browser: https://paul.fragara.com/feed.xml

2/ Similarly, to embed the feed dynamically on the homepage, using JavaScript XSLTProcessor (https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcess...)

This works on all major browsers (and even on IE!) The XSL sheet is here: https://gitlab.com/PaulCapron/paul.fragara.com/-/blob/master...

In another context, I’ve leveraged XSLT 2.0, this time in a build process, to slightly transform (X)HTML pages before publishing (canonicalize URLs, embed JS & CSS directly in the page, etc.): https://github.com/PaulCapron/pwa2uwp/blob/master/postprod.x...

palsecam··on Pro-cash movement warns that people could be losing more than they bargained for
Said website: https://EuroBillTracker.com/ Still operational!
palsecam··on LVMH becomes the first European company to surpass $500B in market value
Novo Nordisk is Danish, not Swiss.

https://en.wikipedia.org/wiki/Novo_Nordisk

← PreviousPage 3 of 6Next →