HNHacker News
TopNewBestAskShowJobs

Cyykratahk

359 karma · joined March 21, 2013

[ my public key: https://keybase.io/lachlan; my proof: https://keybase.io/lachlan/sigs/xAUSn8v549wdW2fORf_IxXSCwwvAsSyPCz1vjERAX1E ]
submissionscomments
Cyykratahk··on CSS Curiosities of the Past
The really funky part of the IE6 PNG fix was that the URL of the image in the expression was always relative to the current page URL, not the CSS file that the declaration was in.

I remember having to use Javascript to generate the image path (I cannot quite remember why absolute or root-relative URLs were not an option for us though...)

Cyykratahk··on A stray "j" ruined my evening
A stray "J" I encountered years ago: a certain client's support tickets would often end with a single "J", which was a little confusing as it was not one of their name initials. After a brief investigation, the original email source contained this:

    <font face="Wingdings">J</font>
Which renders as a smiley face.
Cyykratahk··on Handling secrets (somewhat) securely in shells
An alternative to the paste commands is vipe (vi + pipe?) from moreutils which opens an $EDITOR that returns the contents once saved and closed.

It helps with pasting special chars, newlines, and remote sessions without access to the local clipboard.

    secret=$(vipe)
    echo "$secret"
https://manpages.debian.org/jessie/moreutils/vipe.1
Cyykratahk··on Using a laptop as an HDMI monitor for an SBC
I owned an Alienware laptop (M17X R4) many years ago that had a dedicated HDMI input.

It was a strange laptop. MXM socketed GPU, 120Hz screen that came with Nvidia 3DVision shutter glasses, and the worst battery life I've ever experienced.

Cyykratahk··on Help us raise $200k to free JavaScript from Oracle
There is some help text when clicking on the current goal amount:

> If an organiser turns on automated goal setting, GoFundMe adjusts their goal automatically based on the fundraiser’s characteristics and performance. You can see the goal history if GoFundMe has ever made automatic updates.

> To help the organiser reach their goal, we start them at a lower goal and adjust it as donations come in.

Cyykratahk··on PSA: Libxslt is unmaintained and has 5 unpatched security bugs
I'm guessing Google is avoiding the scenario where a contributor "accidentally" commits code with a bug, then later reports the bug they "found".
Cyykratahk··on Document.write
I'd always assumed the opposite, seeing as a browser's primary function is to parse HTML text into DOM nodes as efficiently as possible.

But on the other hand, since document.write (rightfully) gets such little usage - and has a multitude of footguns - I wouldn't be surprised if browsers used a different, slower code path when executing it; if only to prevent it from borking the parser.

Cyykratahk··on Web fingerprinting is worse than I thought (2023)
The most obvious downside for me was remote terminal windows (e.g. using ttyd) being unusable because canvas rendering was "broken".
Cyykratahk··on Exploring Coroutines in PHP
I'd use `yield from` more if I didn't have to re-index arrays before yielding from them:

    function numbers() {
      yield from [1,2,3];
      yield from [4,5,6];
    };
    
    foreach (numbers() as $k => $v) { echo "$k => $v\n"; }
    0 => 1
    1 => 2
    2 => 3
    0 => 4
    1 => 5
    2 => 6
Cyykratahk··on Scroll snapping, state queries, monster hunter, and gamification
It's great to see more progress around scroll snapping - I'll have to check out this scroll-state container query and the new events.

The biggest missing scroll-snap feature I see is the ability to tell a scrolling container to "snap to the next position in this direction", and maybe by extension "which element(s) are currently snapped". In this article clicking an arrow moves the scroll position by a fixed 40px, but it would be very nice to have a proper API that accounts for element sizes, snap alignments, out-of-axis children, etc.

I ended up writing a package a few years ago that does this (scroll-snap-api). It feels so dirty to calculate the styles on every child in the tree just to find scroll snap positions.

Cyykratahk··on Pipelining might be my favorite programming language feature
We might be able to cross one more language off your wishlist soon, Javascript is on the way to getting a pipeline operator, the proposal is currently at Stage 2

https://github.com/tc39/proposal-pipeline-operator

I'm very excited for it.

Cyykratahk··on On JavaScript's Weirdness
For anyone who wants to see some more explanations/experimentations around for loop semantics, this Chrome Developers video is great:

https://www.youtube.com/watch?v=Nzokr6Boeaw

Cyykratahk··on Flaw has Microsoft Authenticator overwriting MFA accounts, locking users out
For a long time GA had no method to back up or extract the data. It also excluded itself from ADB backups. One had to root their phone to extract the data.
Cyykratahk··on Early Bookcases, Cupboards and Carousels
Woah, those book wheels are like the 16th century version of having 200 browser tabs open.
Cyykratahk··on Take a look at Traefik, even if you don't use containers
I've used caddy-docker-proxy in production and it doesn't cause Caddy to drop connections when loading a new config.

I just tested it locally to check and it works fine.

Cyykratahk··on Font height differences between Windows and Mac (2019)
CSS now has the ability to override some font metrics, so you shouldn't need to edit the font files directly.

And these overrides can be applied to local fonts as well (generally used to ensure the metrics of the local fallback font matches the yet-to-be-downloaded web font, preventing a layout shift when the web font is swapped in)

ascent-override - https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/...

descent-override - https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/...

line-gap-override - https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/...

size-adjust - https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/...

Cyykratahk··on Why you can't divide by zero
Exactly. And I find this is also the best explanation to give to people who don't have a maths background, but who still want to know "Why does the calculator say ERROR?"
Cyykratahk··on Horrible edge cases to consider when dealing with music (2022)
Apple music dislikes the song "⎆" so much that it's entirely missing from the album in my account.
Cyykratahk··on Keystroke timing obfuscation added to ssh(1)
I think it was to provide an indication that the password was correct at a glance. (IIRC the number of dots in the password field was also generated, so it didn't necessarily match the number of chars)

The image was essentially a simple checksum. Each user would eventually memorise which icon was "theirs".

Cyykratahk··on Be careful of the examples you use. They stick
Ah, that's a good point.
Cyykratahk··on Be careful of the examples you use. They stick
Yes, here are the reserved TLDs [0]:

    test
    example
    invalid
    localhost
    local
    localdomain
    domain
    lan
    home
    host
    corp
0. https://www.ietf.org/archive/id/draft-chapin-rfc2606bis-00.h...
Cyykratahk··on Tunnel Vision: CloudflareD AbuseD in the Wild
I feel like this is just another case of "It rather involved being on the other side of this airtight hatchway" [0]

If an attacker is capable of installing apps on your server... you've already lost.

0. https://devblogs.microsoft.com/oldnewthing/20060508-22/?p=31...

Cyykratahk··on Just normal web things
I believe most of the issues with broken link behaviour results from the lack of higher-level methods to override the default link behaviour.

An example: I don't really want to add a click event listener to a link to make it display in a modal (or whatever). Because this event is too low-level and now my listener needs to check modifier keys. What I really want is to somehow tell the browser "if the current window URL is about to change via this anchor element, call this function instead". The user is still free to open their links in new windows or tabs and my code will not be triggered for those cases.

A CSS example: I don't really want to set cursor images for every element and pseudo-class. I'm forced to list every element that uses the cursor I'm overriding. What I really want is to tell the browser "use this custom cursor image wherever you were going to use the default (hand/wait/resize/etc) cursor". My code would then be future-proofed for new elements/UI.

Sometimes I feel that certain browser APIs suffer from the XY problem.

Cyykratahk··on Regional handwriting variation
My mother uses both "double-storey" a and "loop-tail" g in all her handwriting, even throwaway notes and shopping lists. Most likely due to working for many years as a graphic artist/signwriter.
Cyykratahk··on A new line drawing method for the cycle savvy
If anyone wants to see a recording of the demo, click on the "Boo!" link in the article to view its entry on the CSDb site. The blue sidebar on the right has a YouTube link.
Cyykratahk··on I made my blog solar-powered, then things escalated
The biggest problem with MPG is its inverse nature makes it a bad unit to use to compare cars.

A 20 MPG car is not twice as efficient as a 10 MPG car.

http://www.mpgillusion.com/p/what-is-mpg-illusion.html

L/100km has the length and volume units reversed, which allows comparisons.

Cyykratahk··on Amazon starts flagging frequently returned products that you maybe shouldn’t buy
Even if it's not trivial to solve perfectly, there are easy wins to be had.

For example: prevent changing the top-level category of a product. E.g. Shoes should not be allowed to become camera gear.

Cyykratahk··on PHP 8.2.4
Version conflicts on shared transitive dependencies is a real problem, to the point that there are tools available to library authors that allow them to rename their dependencies to be under their own namespace to avoid collisions.

If two packages I require depend on incompatible versions of some third package, there aren't any easy ways for me to resolve it.

This problem exists because of the global nature of PHP namespaces.

Cyykratahk··on Samsung “space zoom” moon shots are fake, and here is the proof
But the AI should not have learned to apply a Gaussian deconvolution kernel. If anything it should be applying a lens-based bokeh kernel instead. A true lens blur does not behave like a Gaussian blur.
Cyykratahk··on Avoiding visible texture repetition (2015)
Yeah, The Cicada Principle[0] is a really neat trick. I remember it doing the rounds in web design circles back in the early 2010's

https://web.archive.org/web/20131201024352/http://www.sitepo...

Page 1 of 3Next →