HNHacker News
TopNewBestAskShowJobs

renerick

139 karma · joined May 2, 2023

submissionscomments
renerick··on Sparks – A typeface for creating sparklines in text without code
This is not a realistic scenario whatsoever. Printers tend to print fonts pretty accurately to their on screen presentation. Even using contextual alternates, the perpetrator would have to change the font before printing. But if the perpetrator has this opportunity, they do need the font at all, they can just change the content. For example, CSS media queries that I mentioned in the other comment can show one paragraph on the screen and another when printing. You don't even need to put both in the HTML - CSS ::before and ::after will happily do that for you.

It's also not very wise in general to not read the final printed version of the contract before signing

renerick··on Sparks – A typeface for creating sparklines in text without code
> No, treating some letter sequences like fi and ffi so that the letters stick together in a certain way is not "by this measure".

Except ligatures are not limited to fi and ffi. They can be used to change appearance of any sequence of characters, including words.

> It's noticeable; a B consistently occurs everywhere there is an A, wherever that font is used.

I'm not talking about substituting a single letter. I'm talking about outright obfuscation of a entire texts.

> You can't perpetrate an easter egg whereby a certain A is replaced.

Quite the opposite, it is trivial to apply different fonts to different parts of text, so you can keep some parts of text normal, and some parts (like numbers and data) obfuscated. In HTML you may notice some abundance of <span>s, sure, but in PDF? Literally no way, unless you copy-paste everything and compare it.

And this is not a hypothetical scenario or a 'minor threat'. Russian government used precisely this technique to obfuscate data in their online voters turn-out reports: (source in Russian, not found it reported in English) https://habr.com/ru/news/578846/. Have they used more subtle scrambling of only digits and not also mixing letters: who knows how long it would take for anybody to notice. From a technical perspective it's not so different from contextual alternates - both require custom made fonts.

There are other ways to alter document presentation too. Especially in CSS, you can create pseudo-elements, not present in the original HTML, or hide parts of HTML, or use a media query which checks if the page is being printed or not!

> We could prepare a page where every glyph appears, and detect substitutions via OCR.

Why the extra step? Why not take the OCR of potentially compromised document and compare it with its raw content? It would detect every substitution, whether it's ligatures, alternates, media queries etc. Why not inspect the font file for defined alternates directly?

renerick··on Sparks – A typeface for creating sparklines in text without code
That's ridiculous, by this measure font ligatures are also contributing to fraud. Or, heck, even fonts themselves, who stops a font from displaying A as B?
renerick··on The <select> element can now be customized with CSS
> have options drop downs that extend outside the viewport boundaries

Unless this is about something different from what you mean, unfortunately, it's not the case, as stated in the article:

> Using base-select loses a number of features and behaviors:

> The <select> doesn't render outside the browser pane.

renerick··on Hunyuan3D-2-Turbo: fast high-quality shape generation in ~1s on a 4090
Ideas are worthless. There are billions of ideas born and dying every day. It is the execution that gives idea value, it is quality of the execution that determines amount of value
renerick··on Boris Spassky: 1937–2025
Yes, it is common for high level players to just shake hands and resign, when they know the position is lost and their opponents certainly will checkmate them
renerick··on A compendium of "open-source" licenses
Well, the license is a kind of contract, and I think it's technically not incorrect to prohibit execution of created binaries as a condition of the contract. I am not a lawyer though
renerick··on jj: a Git-compatible VCS that is both simple and powerful
What helped me understand jj was concept of Changes against commits. Commits are immutable checkpoints, snapshots of the work done. Changes are mutable sets of, well, changes. Of course, commits are used by the git backend anyway, I'm talking about conceptual level.

The most notable mental shift is that you create a Commit (git add && git commit) after you are done, whereas you create a Change (jj new) before starting working on it, and you don't need to explicitly save it after, you bookmark and push it, or start working on a new change.

Consequently, there is no distinction between working directory, index and the commit history. You only have one concept - Change, and you edit them however you wish, whether it's newly created change, or a very old one, or a merge, or whatever else

From my experience, you should be able to fit any git worklow in this model:

- Anything that requires creating commits is jj new, merge is also jj new.

- If you wish to only save part of the changes (like git add -p) you call jj split.

- git squash is jj squash

- amend is also squash

- rebase is automatic (jj edit or jj new --{after,before})

- git stash is obsolete (everything is saved anyway, just run jj new)

- etc.

renerick··on Tailwind CSS v4.0 Beta 1
After some experimenting I found that Tailwind works best with hybrid approach. The essay[1] is correct, that often you have one-of-a-kind blocks, like headers, footers, etc. that you can just fully implement with TW utilities, reducing cognitive load for class naming and structuring. But for more reusable elements, like buttons, links, inputs, popups, it's just much nicer to have them (and their variations) behind simple `btn btn-blue btn-small`. Even when using component-based approach, it's just much simpler to manage all those various states as explicit classes, rather than re-implementing CSS cascade in JS to determine how to combine corresponding TW utilities. I feel like if Tailwind Labs would be less radical in their marketing strategy, it'd receive a bit less of a backlash. Maybe :)

And I do agree, that moving to better integration with native CSS is a step in the right direction, very curious about future of v4

[1]: https://adamwathan.me/css-utility-classes-and-separation-of-...

renerick··on Show HN: A whiteboard that writes math equations
Fun project, although it does seem to struggle with writing the longer it goes https://imgur.com/TntAViO
renerick··on Fiber optic drone control beats any RF jammer
Unless you get some magically high quality camera on your own drones, the only realistic way to follow this trail is on foot. You can't just guide artillery or missiles to the other end of the wire, and if the Drone was launched over the frontline - there is little to do about it. And nothing stops the operator from pulling at least a part of the wire back, even if it's ripped in the middle - the trail is gone.
renerick··on Fiber optic drone control beats any RF jammer
Spool on the Drone means a a bulk of gradually decreasing weight, depositing the wire as needed. Spool on the station means the Drone has to pull the entire ever increasing length of the wire, which can get stuck or even ripped by the trees or other obstacles
renerick··on Typst: An easy to learn alternative for LaTex
Hypermedia.Systems does - https://dz4k.com/2024/new-hypermedia-systems/

https://hypermedia.systems

renerick··on Typst: An easy to learn alternative for LaTex
I make TTRPG character sheets with Typst. No only they look great with perfect page layout, the programming capabilities allow to compute everything from ability scores automatically, like Excel. It's really well designed, and fast too, VS Code integration just works (for me at least)
renerick··on Sent – Simple plaintext presentation tool
I don't think there is "logic" for screwing up the output, more likely the implementation is bugged and they just didn't bother to fix those glitches, and then put it on the page as "feature". At least, I failed to find any relevant code, but I could easily be missing it. And I still would agree, that kind of sucks
renerick··on Htmx is part of the GitHub Accelerator
> So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml"

Exactly. It can serve HTML partials, or utilize `hx-select` attribute to extract required elements from a full page

> Is there a simple example of a static site using Htmx somewhere?

Not that I'm aware of unfortunately

renerick··on Htmx is part of the GitHub Accelerator
https://zorro.management

Not affiliated with them in any way, but it's made with htmx and some JS for more complex features

As for "new class of web experiences", given that htmx explicitly aims to expand upon what is considered the Old Good approach, not sure if it can provide that

renerick··on Htmx is part of the GitHub Accelerator
Any server-side language with your favorite web-framework and HTML templates system. Static files, PHP, Go, Ruby, ASP.NET Core, Spring etc, as long as you can send HTML pages and HTML partials, you are all set
renerick··on Using XPath in 2023
XPath is implementation detail, used for searching of attributes with a give prefix, and this article is just a public note of how it was done in htmx
renerick··on Using XPath in 2023
Because HTML's on* attributes are not generic, they are hardcoded in the spec, you can't use them to handle arbitrary events. hx-on is an attempt to fill this gap for simple cases, when managing event listeners manually or resorting to _hyperscript or alpine is too much

> it addresses a specific shortcoming of HTML: the on* attributes do not support arbitrary events

> it is much less featureful & useful than, for example, @Alpine_JS, but if you have very basic needs for event handling it can help avoid another dependency

https://nitter.net/htmx_org/status/1679966199667478531#m

renerick··on htmx
I'm sorry, but that's just not fair comparison. You requested a minimal example and then pick the simplest one and tell me that you can implement this minimal example with minimal code. Of course you can fill a div with a random number with Vanilla JS, it can even be just a one liner, but it's not the point.

Your solution, for example, will break if the target div already has content in it. It also won't work if we want to insert the content after or before the element, you need to somehow keep track of the element being triggered, so it will grow more complex.

And still, it won't work with custom events

> No need to bring up multiple examples. We just need one to show that htmx makes something simpler.

This approach is not productive. A single example could be easily dismissed on the ground that it's not enough to justify design decisions that htmx has. I wrote multiple examples and provided additional links specifically to show various use cases that htmx covers and to avoid playing ping-pong of tiny examples.

> This isn't one though.

You just picked one example, which also happened to be the simplest, and seemingly ignored everything else. I apologize, I don't know how to continue from here.

renerick··on htmx
These are multiple minimal examples, they are completely self contained, independent of each other and separated by h1 tags.

I separated those examples to different files: https://plnkr.co/edit/0TWYrtbMGP9UAzE4

Also, you may notice there is <template/> tag. It's just for the demo [1], it serves as a mock endpoint

[1]: https://htmx.org/docs/#creating-demos

renerick··on htmx
Here you go: https://plnkr.co/edit/DQJrBWWQFgHtpltf?open=index.html&previ...

Another big aspect of allowing to handle any event is integration with other JS libraries. See this basic example of interacting with Sortable JS [1]

Also, htmx has a response header called `HX-Trigger`[2] which lets server trigger custom events on the client and you can handle those events as well[3]. This is quite useful if you have interdependent data and you want to refresh regions on the page in response to user actions somewhere else (for which htmx allows multiple different patterns for different scenarios)[4]

[1]: https://htmx.org/examples/sortable/

[2]: https://htmx.org/headers/hx-trigger/

[3]: https://htmx.org/attributes/hx-trigger/#triggering-via-the-h...

[4]: https://htmx.org/examples/update-other-content/

renerick··on htmx
Offline functionality naturally requires client-side code to handle storage, caching, synchronization etc, so client oriented frameworks are preferable in those scenarios. However, this comes at the cost of additional complexity, and I argue that this complexity may be unnecessary and htmx may help you achieve your goals easier

You said it yourself:

> We all have finite time and it's great to learn something once and be able to use it multiple times.

We all have finite time and it's great to use tools that help us work efficiently, following the strengths of those tools, instead of having to maintain unnecessarily complex solutions

renerick··on htmx
It is explicitly NOT a silver bullet

https://htmx.org/essays/when-to-use-hypermedia/#hypermedia-n...

renerick··on htmx
You are missing the fact that html has very restricted list of events that can be defined in an attribute. Htmx allows to listen on any event, plus some extra features on top, such as event throttling, polling, synchronization between elements. Stylistically I can see the appeal of your proposal and even agree on some ways, but it's not functionally equivalent

https://htmx.org/attributes/hx-trigger/ https://htmx.org/attributes/hx-sync/

renerick··on Htmx Is the Future
> if you ever need more than just the web-client (i.e. a mobile app, native or otherwise) since you will now have to implement an API anyway, which you could've done in the first place

Unless your new client is a hybrid/webview/electron application, it's a trap. APIs for web, for native and public API have different sets of constraints in terms of authentication, versioning, even features are probably gonna be different.

And it's not like building an API after you built web would be complicated. Unless you put your business logic right into controllers/handlers, making an API would be just making a new endpoint that calls to existing application services. It's not free, it may not be trivial, but like other comment said, if you can afford a new client, you probably can afford an API for it

renerick··on Htmx Is the Future
Htmx actually can be used with these restrictions, there is an extension to do client side rendering from a JSON response [1]. And you can make htmx send JSON requests instead of form data [2].

The idea is easily extendable to any template engine, so you can keep your device response minimal while enjoying the simplicity of htmx. I will admit though, this approach gets funky much faster, than returning HTML fragments, so you probably shouldn't exclusively build your app with this client-side-templates

[1]: https://htmx.org/extensions/client-side-templates/ [2]: https://htmx.org/extensions/json-enc/

renerick··on Htmx Is the Future
I'm not a developer of either of these, but here are two examples:

- https://htmx.org/essays/a-real-world-react-to-htmx-port/ by https://github.com/David-Guillot - a SaaS product migrated to htmx from React.

- https://zorro.management/ by https://twitter.com/Telroshan - a kanban project management tool. This one is particularly interesting IMO, it implements quite advanced UI with htmx and some custom JS.

renerick··on Htmx Is the Future
As mentioned, htmx will attach a `HX-Request: true` header to the request[1]. The server can check this header and either return a partial for swapping, or a full page/redirect like in good old days. Same with any request. This is one way of how htmx provides "progressive enhancement". Sure, this may not be as transparent, as other JS-first frameworks implement it, but it's not complex at all.

The only thing that might cause trouble is non-standard (as in HTML standard) HTTP methods, which basically means any method other than GET and POST, I admit that. However, the fact that these methods are not supported even in HTML5 is a huge miss.

[1]: https://htmx.org/reference/#request_headers

← PreviousPage 2 of 3Next →