// suppress-node-warnings.cjs
// inspired by
// https://github.com/nodejs/node/issues/30810#issuecomment-1383184769
const { emit: originalEmit } = process;
function suppresser(event, error) {
return event === 'warning' && error.name === 'ExperimentalWarning'
? false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "WebContainer project configuration", | |
"description": "https://developer.stackblitz.com/docs/platform/project-config/", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"installDependencies": { | |
"title": "Install npm dependencies when opening the project.", | |
"description": "Defaults to true. Set to false to disable.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:lts-alpine AS builder | |
ARG PNPM_HOME="/root/.local/share/pnpm" | |
ARG PATH="${PATH}:${PNPM_HOME}" | |
WORKDIR /app | |
COPY . . | |
RUN npx --yes pnpm add --global pnpm@latest && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ts-node | |
import fs from "node:fs/promises"; | |
import tinify from "tinify"; | |
/** | |
* This script will travel through the public folder and its subdirectories and | |
* compress all images with tinify. It will also convert all images to webp. | |
* then it will delete the original images. | |
* | |
* You can run this with ts-node: |
Install GnuPG and GitHub official CLI tool. Instructions:
- GitHub CLI https://github.com/cli/cli#installation
- GnuPG https://gnupg.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run with: bash docker-delete-everything.sh | |
# Stop all containers | |
docker stop $(docker ps --all --quiet) | |
# Delete all containers | |
docker rm $(docker ps --all --quiet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh - | |
# USAGE: sh vercel-deploy-env.sh <filename> <environment> | |
# EXAMPLE: sh vercel-deploy-env.sh .env production | |
while IFS== read -r name value | |
do | |
echo "$value" | vercel env add "$name" "$2" | |
done < "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextResponse, type NextRequest } from "next/server"; | |
import { getToken } from "next-auth/jwt"; | |
export const config = { matcher: "/", runtime: "experimental-edge" }; | |
/** | |
* This middleware ensures auth on all routes. | |
* The file should be placed in the root directory of the project. | |
* E.g., /middleware.ts, or /src/middleware.ts | |
* |