Skip to content

Instantly share code, notes, and snippets.

@yesokay
yesokay / aws-lambda.md
Last active January 31, 2018 18:34
Presentation notes: Going serverless with AWS Lambda (September 15, 2016)

Going serverless with AWS Lambda

We used to have some specific problems…

  • "We’re expecting requests per second to fluctuate between 2 and 30,000."
  • Oops, we put the wrong instance in the load balancer.
  • Oops, beanstalk crapped its pants.

But in 2015, we discovered AWS Lambda and it changed the frame of reference for a lot of problems.

We went from bare metal, to VPS setups, to Platform as a Service (Heroku), to containers (Docker), to FaaS – Function as a Service, currently best represented by AWS Lambda.

#!/usr/bin/env python3
'''
Since stash.ai became a paid-only service while still offering a super buggy product, I decided to switch to Raindrop.io
This shamelessly sloppy script might help you do the same.
Usage: ./stash-to-raindrop.py stash-export.json generated-file
'''
@yesokay
yesokay / redirect.md
Created June 13, 2023 17:58
Nuxt 3 static site redirect solution

Problem

I was trying to redirect a /page to https://page.example.com as we're moving around a few things on a static generated Nuxt 3 site.

Trial & Error

  1. routeRules redirect should be the defacto way illustrated quite simply here, but turns out it's a tall order – this doesn't work with static sites, and nor does using redirect inside a /pages/page.vue's script tag.
  2. I also found a middleware solution, which also works under yarn dev but not when the site is generated.

Solution

We revert to good old http-equiv="refresh" with the new SEO/meta components of Nuxt.