Skip to content

Instantly share code, notes, and snippets.

View richmonkeys's full-sized avatar

Jeff Wong richmonkeys

View GitHub Profile
@richmonkeys
richmonkeys / upsert.pb.js
Last active September 5, 2025 07:54
PocketHost collection upsert
routerAdd("PUT", "/api/collections/:collectionName/records", (c) => {
const collectionName = c.pathParam("collectionName")
const info = $apis.requestInfo(c)
const requestData = info.data
const data = requestData.data
const key = requestData.key
const filter = requestData.filter
const collection = $app.dao().findCollectionByNameOrId(collectionName)
const withResult = requestData.withResult
let result = null
@richmonkeys
richmonkeys / next.config.js
Created December 14, 2020 11:59
Decrypt Encrypted Environment Variables at run time. (Nextjs)
// reference: https://leerob.io/blog/vercel-env-variables-size-limit
/**
* Encrypt your environment varibles and store them into a directory (we are using @richmonkeys/aes-256-gcm in this gist)
* e.g.: envs/ENCRYPTED_SUPER_SECRET.enc
*
* You can also store unencrypted env there, just omit the .enc file extension
* e.g.: envs/NOT_IMPORTANT_PLAINTEXT
*/
// using an encryption helper, more info at https://github.com/richmonkeys/aes-256-gcm
@richmonkeys
richmonkeys / K8s-DigitalOcean-CoreOS.md
Created January 30, 2019 13:12 — forked from kevashcraft/K8s-DigitalOcean-CoreOS.md
How to Setup Kubernetes on DigitalOcean with CoreOS

Kubernetes on DigitalOcean with CoreOS

Let's look at an example of how to launch a Kubernetes cluster from scratch on DigitalOcean, including kubeadm, an Nginx Ingress controller, and Letsencrypt certificates.

Overview

Environment

We'll be creating a four-node cluster (k8s-master, k8s-000...k8s-002), load balancer, and ssl certificates.

Table of Contents

  1. Install Kubernetes