Readit News logoReadit News
Cyykratahk commented on Handling secrets (somewhat) securely in shells   linus.schreibt.jetzt/post... · Posted by u/todsacerdoti
Cyykratahk · 2 months ago
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 commented on Using a laptop as an HDMI monitor for an SBC   danielmangum.com/posts/la... · Posted by u/hasheddan
GuB-42 · 5 months ago
I wonder why it hadn't been a built-in feature on some laptops.

No software, just a built-in hardware kvm exposing the screen, keyboard and pointing device to an external port.

A niche thing, but it shouldn't be expensive to implement, and the ports are already here (usb-c, hdmi).

Cyykratahk · 5 months ago
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 commented on Help us raise $200k to free JavaScript from Oracle   deno.com/blog/javascript-... · Posted by u/kaladin-jasnah
nchmy · 6 months ago
The gofundme is now saying $55k target... Which is it?
Cyykratahk · 6 months ago
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 commented on PSA: Libxslt is unmaintained and has 5 unpatched security bugs   vuxml.freebsd.org/freebsd... · Posted by u/burnt-resistor
Wowfunhappy · 6 months ago
> Google refused to pay bounties for valid reports because I was a contributor to libxslt

Huh?

Cyykratahk · 6 months ago
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 commented on Document.write   vladimirslepnev.me/write... · Posted by u/cousin_it
Sjeiti · 7 months ago
I also thought the writing/parsing makes it a lot slower than DOM createElement methods. Here's also an interesting SO thread: https://stackoverflow.com/questions/802854/why-is-document-w...
Cyykratahk · 7 months ago
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 commented on Web fingerprinting is worse than I thought (2023)   bitestring.com/posts/2023... · Posted by u/xrayarx
mysterypie · 8 months ago
> go to about:config and setting privacy.resistFingerprinting = true in your Firefox browser

Two questions jump to mind:

Why isn't this the default in Firefox?

What is the downside? I.e., what can break by enabling this parameter?

Cyykratahk · 8 months ago
The most obvious downside for me was remote terminal windows (e.g. using ttyd) being unusable because canvas rendering was "broken".
Cyykratahk commented on Exploring Coroutines in PHP   doeken.org/blog/coroutine... · Posted by u/doekenorg
Amakanski · 8 months ago
>> This would require a yield to syntax, which doesn't exist.

There is however the 'yield from' statement.

Cyykratahk · 8 months ago
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 commented on Scroll snapping, state queries, monster hunter, and gamification   utilitybend.com/blog/the-... · Posted by u/tobr
Cyykratahk · 9 months ago
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 commented on Pipelining might be my favorite programming language feature   herecomesthemoon.net/2025... · Posted by u/Mond_
bnchrch · a year ago
I'm personally someone who advocates for languages to keep their feature set small and shoot to achieve a finished feature set quickly.

However.

I would be lying if I didn't secretly wish that all languages adopted the `|>` syntax from Elixir.

```

params

|> Map.get("user")

|> create_user()

|> notify_admin()

```

Cyykratahk · a year ago
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 commented on On JavaScript's Weirdness   stack-auth.com/blog/on-ja... · Posted by u/n2d4
pcthrowaway · a year ago
Many mistakes in section 2. The author seems to fundamentally misunderstand block scoping vs lexical scoping, and interactions when deferring execution to the next run of the event loop.

In the first example:

    for (let i = 0; i < 3; i++) {
      setTimeout(() => console.log(i));
    }
    // prints "0 1 2" — as expected
    
    let i = 0;
    for (i = 0; i < 3; i++) {
      setTimeout(() => console.log(i));
    }
    // prints "3 3 3" — what?
i's scope is outside the for loop in the second example, and the setTimeouts execute in the call stack (e.g. the next run of the event loop), after i has finished incrementing in the first event loop iteration

Consider that you'd have the same issue with the older `var` keyword which is lexically scoped

    for (var i = 0; i < 3; i++) {
      setTimeout(() => console.log(i));
    }
    // prints "3 3 3" because i is not block-scoped
If for some reason you really need some work run in the next call stack, and you need to use the value of a variable which is scoped outside the loop and modified inside the loop, you can also define a function (or use an iife) to pass the value of i in the current iteration into (rather than getting the reference of i in the event loop's next call stack)

    let i = 0;
    for (i = 0; i < 3; i++) {
      (
        (x)=>setTimeout(()=>console.log(x))
      )(i)
    }
    // prints 1 2 3

Cyykratahk · a year ago
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

u/Cyykratahk

KarmaCake day321March 21, 2013
About
[ my public key: https://keybase.io/lachlan; my proof: https://keybase.io/lachlan/sigs/xAUSn8v549wdW2fORf_IxXSCwwvAsSyPCz1vjERAX1E ]
View Original