News for hackers. Stuff that matters.

andrus

Re:My adventure in designing API keys on Wednesday April 15, 2026 @03:39AM (#47775843)
GitHub introduced checksums to their tokens to aid offline secret scanning. AFAIK it’s mostly an optimization for that use case. But the checksums also mean you can reveal a token’s prefix and suffix to show a partially redacted token, which has its benefits.
Re:Toon – Token Oriented Object Notation on Tuesday October 28, 2025 @04:59AM (#45730579)
Yes, this is valid JSON: []
Don’t recent Node.js releases support this already? require(esm) was back ported to Node.js 20 in February
Re:How I write HTTP services in Go after 13 years on Friday February 09, 2024 @04:49PM (#39320928)
I’ve found it hard to apply this pattern in Go since, if Username is embedded in a struct, and you forget to set it, you’ll get Username’s zero value, which may violate your constraints.
Re:Show HN: Bring phone calls into the browser (sip-to-WebRTC) on Thursday January 04, 2024 @10:04PM (#38875225)
AFAIK, Twilio is shutting down its Video product. I don’t think its Voice product is affected (although the SDKs for both use WebRTC).
Re:Terraform module for scalable GitHub action runners on AWS on Saturday December 09, 2023 @06:11AM (#38580867)
> That said, do many see value is in this?

GitHub don't host runners for Linux × arm64, so if you need this, you need to self-host. You can also run custom AMIs with pre-installed packages, which can speed up workflows that depend on those packages.

> When things go wrong, you need people going through logs working out that there's nothing actually wrong with CI…

I'm on a small team who've been running the Philips Lab self-hosted runners for the past year. It hasn't been difficult to operate. Once deployed, it pretty much "just works".

In my experience, the things that go wrong originate from the GitHub workflows themselves. We usually have to review workflow logs regardless of whether the workflow uses a self-hosted runner or not.

Re:An updated Node-WebRTC that works with Node Stable on Thursday October 05, 2023 @03:01PM (#37782712)
Hey, you're welcome! And actually, yes — I reached out to @duvallj from GitHub regarding this earlier today. He has my original email, or you could email me at my address in my HN account info.
Re:An updated Node-WebRTC that works with Node Stable on Thursday October 05, 2023 @02:54PM (#37782586)
Yw! I'm hard at work on https://www.propeldata.com/, but always curious to see what's going on in the WebRTC space :-)
Re:An updated Node-WebRTC that works with Node Stable on Thursday October 05, 2023 @05:55AM (#37776666)
This is very cool to see. I haven't been able to work on or maintain node-webrtc since 2021, but I'm glad people still find these bindings useful.

    app : Vect n a -> Vect m a -> Vect (n + m) a
is a type signature for a function, `app`, which should append a vector (`Vect`) of length `n` to a vector of length `m`.

What's cool about Idris and other dependently-typed languages is that the length of the resulting vector, `n + m`, can be tracked in the type. This can prevent a whole slew of errors.

Re:Data-Driven Tests in JavaScript Using Mocha on Friday November 27, 2015 @05:11PM (#10639067)
The theory here is good, but I think the implementation is lacking. Haskell's QuickCheck is one of the most mature frameworks for doing what the author calls "data-driven testing", so It might be worth mentioning one of the JavaScript ports compatible with Mocha: node-quickcheck, JSCheck, etc.
Re:ORTC API is now available in Microsoft Edge on Friday September 18, 2015 @03:17PM (#10241454)
ORTC can interop with WebRTC, so you could create a an Edge to Chrome or Edge to Firefox scenario. In fact, you can implement (to some degree) the WebRTC APIs in terms of the ORTC APIs.
Re:Computer Sciences Courses That Don't Exist, but Should on Thursday September 10, 2015 @11:02PM (#10201785)
CSCI 0911 and CSCI 0912 are real, though they go by CMSC-16100, CMSC-22311, and CS240h (and I'm sure more).

So do I pass CSCI 0555? ;-)

Re:Effectful Haskell: IO, Monads, Functors on Saturday August 29, 2015 @01:38PM (#10140749)
Yes, Fantasy Land is a specification of Monad (as well as other type classes) for JavaScript:

https://github.com/fantasyland/fantasy-land

Re:Boto3 – AWS SDK for Python on Monday June 22, 2015 @08:05PM (#9761940)
I am glad the docs have improved. For example, RoutingRules: you used to have to go to the code to figure out how to use them.
Re:We have a problem with promises on Monday May 18, 2015 @02:26PM (#9566041)
I think the confusion stems from the fact that .then() acts like either .map() or .flatMap() depending on the return type.

If .then() was just .flatMap(), you could expect an error if you didn't return a Promise (for example, reject with a TypeError).

If .then() was just .map(), you could return a value of any type (for example, string or Promise<number>) and get back a Promise for a value of that type (Promise<string> or Promise<Promise<number>>).

Re:Korg volca sample SDK – a sample and sequence encoding library on Wednesday November 19, 2014 @05:14PM (#8633014)
Why is this called "SYRO"? Confusing considering the recently-released Aphex Twin album...
Re:Pissed off about functional programming (2005) on Tuesday August 05, 2014 @10:32PM (#8140717)
Relevant discussion on LtU: http://lambda-the-ultimate.org/node/678
The EitherIO data type given is

  data EitherIO e a = EitherIO {
      runEitherIO :: IO (Either e a)
  }
But, for the sake of clarity, it can be written as

  data EitherIO e a = MakeEitherIO {
      runEitherIO :: IO (Either e a)
  }
The author pointed out two functions that this EitherIO declaration gave us. One is a constructor, MakeEitherIO, with type

  IO (Either e a) -> EitherIO e a
In other words, MakeEitherIO takes a value of type IO (Either e a) and returns a value of type EitherIO e a (you could think of this as "wrapping" the original IO value).

The second function, runEitherIO, is an accessor function for EitherIO's named record field "runEitherIO". It has type

  EitherIO e a -> IO (Either e a)
That is, runEitherIO takes a value of type EitherIO and returns the internal value of type IO (Either e a) (you could think of this as "unwrapping" the IO value).

I hope that helps!

Re:Rest – A Haskell REST framework on Monday June 30, 2014 @03:16PM (#7967000)
Google "haskell rest". Done. See @sfvisser's comment: https://news.ycombinator.com/item?id=7965468
Re:JavaScript Promises in Wicked Detail on Wednesday April 30, 2014 @09:04PM (#7677551)
No, "automatically unboxing the promises that are returned" does not give Promises "the full power of Monads", because you cannot represent a Promise for a Promise for a value. Promises/A+ breaks parametricity.
Re:JavaScript Promises in Wicked Detail on Wednesday April 30, 2014 @04:08PM (#7676056)
The Promises/A+ assumption that you'd never want a Promise to return a Promise is really shortsighted.
Re:Functional Programming 101 with Haskell on Friday January 24, 2014 @12:55PM (#7116247)
Neat, I knew about `:set +m` for enabling multiline input, but not `:{ ... }:`.
Re:Useful Unix commands for data science on Monday July 15, 2013 @01:26PM (#6047046)
Just for grins:

    $ alias sum="xargs | tr ' ' '+' | bc"
    $ echo -e "1\n2\n3\n" | sum
    6
Re:Better line numbers for Vim on Sunday July 14, 2013 @05:29PM (#6042326)
Actually, he was in normal mode and issued

    5dd
at the start of the block.
Re:Source Code Typography on Friday May 17, 2013 @02:36PM (#5725985)
Would like to know whether the author feels his rewrite is more successful than the original. The following takes me longer to read:

    for (
                              ;
            (*to = *from) != 0;
            ++from, ++to
        )
        ;
Whereas the idiomatic version seems simpler:

    for (; (*to = *from) != 0; ++from, ++to);

Older »