HNHacker News
TopNewBestAskShowJobs

phil294

1,761 karma · joined October 15, 2019

hi! you can contact me at hn@waritschlager.de or http://waritschlager.de

Userscript for sticky, contextual comment trees on HN: https://greasyfork.org/en/scripts/427429

submissionscomments
phil294··on Show HN: Little Rat – Chrome extension monitors network calls of all extensions
Same, but on Firefox, the latter can be nicely configured both on a default and on a per-extension basis.
phil294··on Postgres Language Server
To add to the correct IntelliJ answer: VSCode, on the other hand, does not allow for multiple language services or servers to handle the same file at the same time. Instead, any language support (always by means of extension, either built-in or external) has to individually add support for embedded languages, either using language services or request forwarding [1]. For example, the built-in HTML plugin includes JS support inside <script/> tags by simply spinning up its own tsserver [2].

This seems to have been a design decision from the very start, but I have a hard time understanding why. It seems like a conceptual mistake to me. It also eats up system resources like crazy, but that's a lost cause anyway. Instead of harnessing the capabilities of existing implementations, every "wrapper" kind of language needs to build its own solution, which leads to these solutions often not being great. For example, said HTML/JS solution has issues with external dependencies [3]. Or, I've been trying to enable support for CoffeeScript or Elm inside Vue Single File Component files, but I couldn't so far, even though I'm the author of the CoffeeScript extension. [4][5]

Any source file always has exactly one language type assigned to it (possibly auto-detected), so no, dynamically "switching" is not possible without manually changing it for the entire file. For things like SQL inside PHP, Jetbrains products really are superior.

[1] https://code.visualstudio.com/api/language-extensions/embedd... [2] https://github.com/microsoft/vscode/blob/7fd6f1b1d46bd2223a9... [3] https://github.com/microsoft/vscode/issues/26338 [4] https://github.com/vuejs/language-tools/issues/3200 [5] https://github.com/vuejs/vetur/issues/1184

phil294··on Rethinking Window Management
Just FYI the exact same thing is now also possible with AHK_X11 on Linux https://github.com/phil294/AHK_X11
phil294··on Ask HN: Can VimiumC compromise your privacy with TorBrowser?
Vimium is a browser addon. It alters the dom on key press, so I assume the answer to OP is yes, although I have no insight in common fingerprinting.
phil294··on Language Learning with Netflix
Correct, and you can find CCs more likely on movies and shows that were shot in the respective language itself. For example, the stuff from https://www.netflix.com/browse/genre/100396 is much more likely to have 100% accurate captions if your goal is to learn Spanish
phil294··on Flutter Web: A Fractal of Bad Design (2020)
Previously also here, three years ago: https://news.ycombinator.com/item?id=24962504

Unfortunately, the malicious state of Flutter web has not changed.

phil294··on Somehow AutoHotKey is kinda good now
https://github.com/phil294/AHK_X11
phil294··on Angular v16
Angular is as little innovative for web frameworks as Firefox-ESR is for browsers. It merely keeps copying features from other frameworks - just many years later. It is a chronically outdated framework that always struggles to keep up with its competitors. It would be ok if those were deliberate design decisions, but if the features get copied some day anyway, what is the point? Why not do it the right way from the start?

For example, this update brings us computed properties, an essential feature for any complex performant web application that was made popular by Vue.js 10 years ago [1]. And now in 2023 we get it in Angular, essentially a confirmation by its devs that its lack had always been a design error.

I also cannot understand the "mature" argument. For example, it took five years for documentation on the integral `<ng-content>` to arrive [2]. This is something I'd expect from the side project of a lone programmer, not an enterprise-level framework.

The only upsides of Angular are its "batteries included" approach and the (debatable) default of RXJS, while the downsides are plenty (see other comments).

[1] https://github.com/vuejs/vue/tree/218557cdec830a629252f4a9e2... [2] https://github.com/angular/angular/issues/17983

phil294··on Vim-like “jump” cursor for Mac OS Window Management
I made this for Linux recently too: https://github.com/phil294/vimium-everywhere (X11, Wayland coming soon)
phil294··on Ask HN: What lesser-known accessories do you use with your computer?
did you put it directly into sunlight or was the screen itself put in shadow? (makes a huge difference afaik)
phil294··on Barebones project to get an Inkplate 10 using WiFi, HTTPS using the Arduino IDE
Please let me know should you stumble over some useful resources! I'm interested in this too. Sorry I don't have anything more to add.
phil294··on Vimium – A browser extension that provides Vim-style keyboard controls
There's Vimium Everywhere, a very recent tool for Linux of mine. I don't know of any other. https://github.com/phil294/vimium-everywhere
phil294··on AutoHotkey v2 Official Release Announcement
Have you checked fsearch? https://github.com/cboxdoerfer/fsearch It got very good in the last 1-2 years and while ext4 fs don't support a file index like NTFS does, fsearch is still very fast, caches its results, offers similar features etc.
phil294··on AutoHotkey v2 Official Release Announcement
I haven't used AutoKey personally, but it's quite capable and generally "just" a Python library that also happens to ship with its own optional editor (https://autokey.github.io/autokey/_images/AutoKey_Scripting....).

Keysharp / AHK_X11 on the other hand ship their own runtimes that will be / are compatible with the actual programming language AutoHotkey v2 / v1 and thus cannot be used in conjunction with other languages, apart from shell invocation. For a detailed feature comparison with AutoKey you will have to research this yourself, but there's at least one feature which is exclusive to AHK_X11 right now, and that is accessibility-related commands such as ControlClick or WinGetText.

phil294··on AutoHotkey v2 Official Release Announcement
Check out https://bitbucket.org/mfeemster/keysharp/ and https://github.com/phil294/AHK_X11, two attempts at reimplementing AHK on Linux. The former is v2 but not usable yet, the latter is by me, v1 "classic" and somewhat incomplete.
phil294··on Explore Wikipedia's New Look
Plug: I made https://github.com/phil294/density-userstyle which is a global userstyle to remove unnecessary paddings on common websites. Will probably have to add Wikipedia soon.
phil294··on Wasavi – Vi editor for any webpage
This looks very similar to shortcat https://shortcat.app/, can you tell me what your program offers that the other one (free, but also not OS) does not?

On an unrelated note, I made the same thing (barebones), but for Linux and theoretically also Windows: https://github.com/phil294/vimium-everywhere

phil294··on Weird Laptops are Coming – CES 2023
https://www.theverge.com/2023/1/5/23541379/lenovo-thinkbook-... says: "Just don’t expect Kindle battery life out of a laptop like this since you’ve got the overhead of running Windows on its 13th Gen Intel processor (and up to 16GB of RAM and 1TB of PCIe Gen 4 storage) rather than a simple e-reader chip. Lenovo’s estimating up to 21 hours of battery life from its 56Wh battery using the E Ink screen, and it isn’t providing context about what kind of content can run for 21 hours at a time."
phil294··on Weird Laptops are Coming – CES 2023
Can we not just finally have a normal, boring, standard eink laptop? I've been waiting years for this, but all we got are broken promises, over-engineered weirdnesses like this one and dozens of tablets. I might buy this rotatable one just for that purpose, even though I don't care for the OLED side...
phil294··on AutoHotKey V2 (Breaking Upgrade)
Thanks for the helpful summary. Capturing key presses could also work by talking to the kernel directly.

> There is currently no protocol, stable or unstable, for programs to implicitly grab the content of surfaces under the pointer, let alone read text of textboxes.

Yes there is, AtSpi, the accessibility protocol. But a normal window-independent `Click, X, Y` would indeed be quite important to have...

I'm wondering if there is a way to somehow get active window position, move windows around etc. using root privileges, without relying on a custom compositor extension. Could not find anything.

phil294··on AutoHotKey V2 (Breaking Upgrade)
AHK_X11 is AutoHotkey for Linux and it does not yet support Wayland, but it's definitely possible https://github.com/phil294/AHK_X11/issues/2 (see also: ydotool)
phil294··on It's easier and faster to pirate an e-book, than it is to buy it
I really don't understand why people buy Kobo. I bought a Pocketbook from 2007. It still works perfectly and does not need software updates (nor does it have internet). Transferring books or PDFs is as easy as plugging the device into my computer.
phil294··on Show HN: Vimium Everywhere
yes, after that, the chosen letter location should immediately automatically be clicked. It's optimized for Linux, but the Windows version should work the same. Maybe I missed something? I'll fix the latter tomorrow if so.
phil294··on Show HN: Vimium Everywhere
Hi HN,

this is an AutoHotkey script for Linux/Windows that works like the basics of Vimium [1], but everywhere. This means that upon pressing F, you'll see keyboard-activatable hints for all interactive elements on the current window (there's a gif in the Readme). I built this partly to showcase the recently added accessibility-related features of AHK_X11 0.4.0 [2], my AutoHotkey-for-Linux implementation. a11y on Linux is a mess [3], but IMO it mostly works, just needs a lot of tweaking [4]. Getting all relevant applications to work has been a huge patchwork effort though [5].

I hope I'm not being too impertinent reusing the name "Vimium"... but it's the best I could come up with, and this can probably never be a noteworthy competitor inside browsers anyways, as normal Vimium has the advantage of Browser APIs.

[1] https://github.com/philc/vimium [2] https://github.com/phil294/AHK_X11/releases [3] https://scribe.rip/@r.d.t.prater/linux-accessibility-an-unma... [4] https://wiki.archlinux.org/title/Install_Arch_Linux_with_acc... [5] https://github.com/phil294/AHK_X11/blob/4ff6e749f5f783471f3c...

phil294··on Firefox Translations: Translate websites in your browser without using the cloud
I'm also using Librewolf, and I have no issues using Firefox translate. I must have changed several settings over time, including about:config flags, but apparently it definitely is possible.

Apart from that, I assume it's quite difficult for anyone to help you based on the error description "doesn't work".

phil294··on Marten: a Crystal web framework
I have recently learned to use it to create an AutoHotkey for Linux implementation (https://github.com/phil294/AHK_X11), and it's been a delightful experience. If you like programming in Go and Ruby syntax, this will be your go to language. Other than that, it bears but few surprises, which I would consider a good thing. Its major downside is its compilation time and poor IDE support. Also, you should not be afraid to search through Crystal's GitHub issues or dig into the well designed stdlib's source for more exotic use cases. However, the latter is as easily accessible as is your own code, and the community around Crystal seems quite friendly and welcoming. Contrary to sibling comments, I find it well suited for programs outside of web development as well.

And most of all, it's fast.

phil294··on 98.css – design system for building faithful recreations of Windows 98 UIs
Awesome! I like this a lot.

Recently, I've been attempting to create a global user style sheet that applies a reasonable set of nicely accessible rules to every website, essentially forcing buttons to look and behave like buttons, and to have a consistent theme across the internet. I started out by applying Window 95-like styles, and this is how it currently looks: https://waritschlager.de/share/0E7AB89CE86B1319A671D35EA2697... (background not changed to grey for now), not finished yet. Turns out, writing a global stylesheet is really difficult. For example, you cannot just "make all buttons grey":

First of all, there are many different ways to identify a button. This is a subset of my current button matching rule:

    button, input[type=submit], input[type=button], a[class*="btn" i], a[class*="button" i], *[role=button], *[role=tab], *[role=menuitem], *[role=menuitemcheckbox], a:not([role=button] ...etc) > *:not(div ...etc)
with the last one probably being the most important one next to `button`. ...and this still does not catch all, because you wouldn't believe how often web devs just take some div and put an onclick handler on it without making it accessible.

Secondly, as soon as you overwrite the background color of all buttons, you will lose its background images which may be important. This happens way too often, also surrounding elements which actually have nothing to do with button semantics. So you need to apply a partially transparent background color. While it can still look perfect with the right tuning, it will then look horrible on non-white backgrounds.

There are also way too many nested buttons and empty buttons out there, it all needs consideration.

Finally, to detect a "pressed down" state, you'd normally use `aria-selected`, but barely anyone ever uses that, so it's back to matching class names `.active` and `.selected`, but then you also need to exclude `.inactive`, `.interactive`, `.deselected` and so on...

My conclusion so far is that building a global style sheet is definitely possible, but can get ugly sometimes. And instead of hand-crafting my own styles, I can now integrate 98.css's ones, that's great :-)

Also worth mentioning: A near-perfect win95 XFCE theme: https://github.com/grassmunk/Chicago95

phil294··on 58 bytes of CSS to look great nearly everywhere
Hope you don't mind the self-promo: Here's a GH project of mine which attempts to provide styles for popular websites to remove large paddings and max-widths: https://github.com/phil294/density-userstyle
phil294··on 58 bytes of CSS to look great nearly everywhere
I think this is a valid point. For example, I have always wondered why default browser styles don't at least adjust to the OS's theme - be it Metro, Material, Qt, Gtk, whatever. It would solve a lot of issues for bare-bones websites, while still allowing full configurability for websites via override. And if we really cannot have nice things because of backwards compatibility, make OS integration optional via <meta> tag etc.

Why does every website have to reinvent the wheel?

phil294··on CoffeeScript – AutoHotkey Compiler
Apparently also heavily used in their own projects [1] like [2]

More details in the docs [3]:

> You can think of Coffee-AHK as a dialect of CoffeeScript. It is compatible with the existing AHK code and adds new features to AHK such as anonymous functions, destructuring assignment and even package management support. It is also a subset of CoffeeScript, which compiles into JavaScript code correctly for execution on all platforms.

Fascinating and exotic mix. I've never seen anything like it before.

[1] https://github.com/phonowell/coffee-ahk/network/dependents?p... [2] https://github.com/phonowell/genshin-impact-script/blob/mast... [3] https://github.com/phonowell/coffee-ahk/blob/master/doc.md

← PreviousPage 2 of 6Next →