Better HN
topnewbestaskshowjobs
Log inSign up

kevinmcconnell

313 karma · joined Nov 15, 2010 (16y ago) · 96 submissions

Kevin McConnell
Submissions

comment 4y ago · link · parent

> The server rendered app will ALWAYS have to wait at least 1xRTT for every new render. The SPA does not.

Not necessarily. I think you're conflating caching/fetching and rendering here. You can cache rendered views in the same way you'd cache the data for those views.

Turbo does this, for example. When you navigate to a cached page it will display the page from the cache first, then make a request to update the cache in the background. So it's similar to what you describe, but with server-rendered content.

comment 4y ago · link · parent

> so it breaks the pure function assumption right there

There's no pure function assumption being broken here. React is a framework for rendering UI from state and coordinating updates to that state. That's why we have things like `useEffect`, contexts, and so on. The only part of React that is expected to be free of side effects is rendering.

Put another way, given your example, React just says that you shouldn't issue your Ajax call in your rendering code. Instead, you should do it in response to an appropriate action, such as a change event on your form controls.

comment 4y ago · link · parent

Ah right, my mistake. I’m used to DATEDIFF on other platforms meaning the interval between two dates, and misread.

comment 4y ago · link · parent

You can find the difference between dates by subtracting one from the other, the same way you’d find the difference between two numbers. That’s why there’s no need for a function to do it.

comment 4y ago · link · parent

> It feels like a lot of these freelancing micro-entrepreneurship perspectives sort of ignore this aspect. It's hard to imagine people still doing it when they're 50.

Why do you say that? I’m asking this genuinely, as someone who is a) dipping my toe into freelancing and micro-entrepreneurship, and b) turning 50 next month :)

Personally I’m just looking for a way to find more enjoyment and meaning in my work, and to be able to balance my priorities in life a bit differently. Which is something I didn’t think much about when I was younger, but has come to be important to me as I get older. So to me, this sort of age actually seems like a natural time to want this approach.

comment 4y ago · link · parent

Oh cool, that looks really interesting! I hadn't seen it before, but will definitely try it out. Thanks for sharing.

comment 4y ago · link · parent

> By the way, the link to the Spell Right extension actually links to the AsciiDoc extension.

D'oh! :) Thanks! I've fixed it.

comment 4y ago · link · parent

Ah yes, you're right! Thanks, I'll fix that.

comment 4y ago · link · parent

I used Asciidoctor. It's mostly the default theme, but I tweaked a few things about it.

If you're interested in the details, I wrote a blog post that goes into it a bit more: https://www.kevinwmcconnell.com/writing/how-i-wrote-my-book

That post also has a link to a repo with all the settings/theme/etc, so anyone can take it and use it as a starting point for their own book.

comment 4y ago · link · parent

I found usually they'd be on the order of a few hundred milliseconds. They tend to be quicker if you have more memory allocated to your function (because the additional CPU power helps).

I've mostly found that my cold starts were slow enough to look bad in the metrics, but fast enough (and rare enough) that the impact on user experience wasn't actually that noticeable. Given the other benefits I was getting from Lambda (like the easy scaling and low maintenance), it was worth the occasional small blip in latency.

And for functions that aren't directly user facing -- like processing items from a queue -- I've not found it to be an issue at all.

Of course every use case is different though, and some apps can tolerate this more than others.

comment 4y ago · link · parent

What I've started doing (and how I cover it in the book) is using the CDK to build and deploy the Lambda code. The `GoFunction`[0] construct handles building and deploying the code, so you don't have to set anything up manually.

Underneath it still happens by way of S3 & CloudFormation, but the CDK abstracts away a lot of the details, which makes it quite convenient to use.

[0] https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-g...

comment 4y ago · link · parent

Thanks! And that's a good point about EFS, it's something I've found very useful too. I'm planning to add some updates to the book, so I'll put it on my list of things to include.

Thanks for the feedback!

comment 4y ago · link · parent

I forgot URLs don't become links in the submission text, so here's a clickable one :)

https://kevinmcconnell.gumroad.com/l/lambda-go-book/hn

14.

Show HN: I wrote a book about using Lambda with Go

103 points · by kevinmcconnell · 4y ago · 17 comments

15.

How I Wrote My Book(kevinwmcconnell.com ↗)

96 points · by kevinmcconnell · 5y ago · 22 comments

16.

Amazon CloudWatch Evidently – Experiments and Feature Management(aws.amazon.com ↗)

5 points · by kevinmcconnell · 5y ago · discuss

comment 5y ago · link · parent

I'm seeing that now too.

Refreshing the page seems to make it load properly (for me, at least) so, while not ideal, at least there is a way to work around the problem.

comment 5y ago · link · parent

Also, full disclosure (and shameless self-promotion;)), I have a deal listed in that collection. My book "Make the most of AWS Lambda with Go" is 50% off with this link: http://kevinmcconnell.gumroad.com/l/lambda-go-book/sale

comment 5y ago · link · parent

There's a collection of deals from indie makers, collected by Marie Ng, at https://indiemakerblackfri.glide.page/dl/d0a5f4/s/d0a5f4

And the Twitter thread where it started: https://twitter.com/threehourcoffee/status/14609177735848960...

20.

The Big Indie Maker Black Friday Sale(thebigindiemakerblackfridaysale.com ↗)

1 points · by kevinmcconnell · 5y ago · discuss

21.

A fast(er) de-referer service with CloudFront(kevinwmcconnell.com ↗)

2 points · by lentil · 5y ago · discuss

comment 5y ago · link · parent

Oops, link seems to have lost part of its path.

Should be https://www.kevinwmcconnell.com/aws/faster-referer-service-c...

23.

A fast(er) de-referer service with CloudFront(kevinwmcconnell.com ↗)

1 points · by lentil · 5y ago · 1 comment

comment 5y ago · link · parent

I think you could run this service on CloudFront Functions, if you didn't mind using a Refresh header instead of the meta tag.

(CloudFront Functions can't generate body content, but it looks like this service works by responding with a refresh meta tag. So if you change that to a Refresh header you wouldn't need to write the body.)

CloudFront functions run on the 200+ edge locations of CloudFront and, according to the docs, have sub-millisecond startup times. So might be a viable option?

comment 5y ago · link · parent

You can also set Lightroom to write sidecar xmp files, which means every edited raw file will also have its own copy of the edits kept alongside it.

Coupled with using a good directory structure, that significantly lessens the impact of losing a catalog file.

comment 5y ago · link · parent

I think the difference may be in the "They’re easily revoked and expired" part.

Passwords are usually one-per-resource, e.g. a user has a single password. If that password is compromised you can reset it, but all the consumers that used it will need the new credential.

Whereas tokens are typically one-per-consumer, so if one is compromised you can revoke/expire just that token, without affecting other consumers.

Same with expiry times -- you can set that on a token without it expiring all access to that resource.

Not sure if that's what the author had in mind, but it's a difference in how these things are often used (even if fundamentally they are otherwise very similar).

comment 5y ago · link · parent

While this probably doesn’t completely solve your problem, have you tried using conditional includes in your .gitconfig? I’ve been using that to ensure that anything under ~/work uses my work email for user.email, but anything under ~/projects uses my personal email. It’s quite handy.

https://git-scm.com/docs/git-config#_conditional_includes

comment 5y ago · link · parent

As a Scot, I find that a bit sad. We’re really not that far away!

Does that also mean you never learned about Rabbie Burns in school?

comment 5y ago · link · parent

pubsub would also be misleading, given SQS does not support the pub/sub pattern. It's a queue where each message is processed once by a single consumer; it's not a pub/sub system where multiple consumers can subscribe to messages of interest.
1234