Better HN
topnewbestaskshowjobs
Log inSign up

contextnavidad

110 karma · joined Feb 9, 2023 (3y ago) · 20 submissions

Submissions

comment 1y ago · link · parent

L3 constructs [0].

Define MyProjectLambda construct that handles common patterns, add methods for optional functionality.

[0] https://docs.aws.amazon.com/prescriptive-guidance/latest/aws...

comment 2y ago · link · parent

> Our project was originally full stack NextJS but we wanted to first migrate everything to Python/FastAPI

This is the eye opener for me, how is a startup justifying a re-write when they don't even have customers?

comment 2y ago · link · parent

Take a look at Posteo. Seem to have a similar philosophy as Mullvad.

comment 2y ago · link · parent

> because you can't pass a name string as an argument that is expected to be an email address

Unless you accidentally create the wrong branded type? Which is as likely as disordered arguments.

As you stated, tests should cover this case trivially, I don't see the value in added type complexity.

comment 2y ago · link · parent

Source? There is a similar charge in London, that's all I know of

comment 2y ago · link · parent

Some organisations forbid copy left licenses

comment 2y ago · link · parent

Had good experiences with PM2, however be cognizant of it's copy left license. We have found it redundant with the likes of Kubernetes.

comment 2y ago · link · parent

Midlands is the way to go honestly, great transport links to the whole country, great nature, very cheap living.

comment 2y ago · link · parent

You're a little off on the average UK wage. It's around £34k now.

comment 3y ago · link · parent

> async middleware not handling errors properly thing though

Can you expand on this? Error handling in middleware is pretty well documented.

comment 3y ago · link · parent

Upgrade everything you need with a commit per upgrade, then if something breaks `git bisect` to find the troublesome package.

And read release notes for everything you upgrade too.

comment 3y ago · link · parent

https://www.artillery.io/

comment 3y ago · link · parent

We used `cloneDeep` heavily at a previous role, it isn't particulary fast - so be careful if you cloning very big objects (1mb+). There are faster options out there such as https://github.com/davidmarkclements/rfdc or even https://developer.mozilla.org/en-US/docs/Web/API/structuredC...

comment 3y ago · link · parent

Someone knows how to get voted to the front page

comment 3y ago · link · parent

Looks like you need an env var `OPENAI_API_KEY` for this to work. Strange that it is not documented at all.

Also they could have provided an actual error rather than letting it panic!

comment 3y ago · link · parent

I live in the UK and do not follow the news. I am not aware there is a food shortage!

comment 3y ago · link · parent

From the deployment stage of the pipeline to live traffic hitting the new code, probably a couple of minutes. Limited by image pulls, application startup time and K8s rollout strategy.

comment 3y ago · link · parent

I have my linting setup to force a base on `parseInt`, for the extra characters I do feel it's worth it for the safety.

The extra parentheses is just habit from Prettier formatting :)

comment 3y ago · link · parent

It's great to see other JS runtimes progressing, I have a continued frustration with the lack of decent TS tooling and ESM support in Node.js.

Jest and Mocha both do not support ESM very well out of the box and there is an expectation that you are using babel to transpile to CommonJS for everything to work nicely. (See Jest's _experimental_ support for ESM mocking!). Node.js is only starting to build out a testing framework, and it has a way to go yet until it has any level of feature parity with the established libraries.

Then you have the naive assumption that any package written in JS works with TS. Which is true, they do work, but the missing types will always lead you to look for a TS-first alternative. A good example of this is Joi vs Zod for validation, with the latter performing type inference based on your validation parameters, which is great. But it really does feel like you have a subset of a package ecoystem lurking on NPM.

I am not that confident Deno is the answer, but I would say those are my biggest frustration writing production grade JS/TS code today.

comment 3y ago · link · parent

It passes the value and index to `parseInt`, where the 2nd argument is `base`. So it does not return `[10, 10, 10]` as you'd expect. It returns `[10, NaN, 2]` instead.

You have to do `['10', '10', '10'].map((val) => parseInt(val, 10));` to get the "expected" output. In addition, you should always provide `base` to `parseInt` otherwise it has it's own interpretation infered by the value you give it.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...