Skip to content

Instantly share code, notes, and snippets.

View renanborgez's full-sized avatar

Renan Garcia Borges renanborgez

View GitHub Profile
@renanborgez
renanborgez / README.md
Created January 5, 2024 20:15 — forked from kettanaito/README.md
Chromium on Vercel (serveless)

Chromium on Vercel (serverless)

This is an up-to-date guide on running Chromium in Vercel serverless functions in 2022. What you will read below is the result of two days of research, debugging, 100+ failed deployments, and a little bit of stress.

Getting started

Step 1: Install dependencies

Use chrome-aws-lambda that comes with Chromium pre-configured to run in serverless, and puppeteer-core due to the smaller size of Chromium distributive.

Keybase proof

I hereby claim:

  • I am renanborgez on github.
  • I am renanborgez (https://keybase.io/renanborgez) on keybase.
  • I have a public key ASC9Sn3-xyCSjcsEBxedYMY0MEXYpOBSoxG1GJquLI8nGAo

To claim this, I am signing this object:

@renanborgez
renanborgez / docker-destroy-all.sh
Last active June 21, 2021 11:15 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q) -f
# Delete all containers
docker rm $(docker ps -a -q) -f
# Delete all images
docker rmi $(docker images -q) -f
# Delete all volumes
docker system prune
## Delete local branches already merged
git fetch --prune && git branch --merged | egrep -v "(^\*|master|develop|main)" | xargs git branch -d
## Delete local branches (with force)
git fetch --prune && git branch | egrep -v "(^\*|master|develop|main)" | xargs git branch -d -f