Skip to content

Instantly share code, notes, and snippets.

@epoz
epoz / hang_player.py
Created August 3, 2024 10:32
Simple MIDI .wav Python player for FGDP-50 Hang Drum fun
import mido, os, random
import simpleaudio as sa
INPUT = "./Hang Drum Samples"
wavs = {}
for x in os.listdir(INPUT):
if x.endswith(".wav") and len(x) == 7:
wavs.setdefault(x[0], []).append(x)
note_map = {
@craiglpeters
craiglpeters / dev-containers-cloud-native.md
Last active March 29, 2025 18:23
Dev Containers in the Cloud Native Ecosystem

Dev Containers

https://containers.dev an open spec that extends container definition to also include dev environment configuration including:

  • packages
  • lifecycle automation
  • processes
  • IDE configurations
  • remote connection
  • port forwarding
# Source: https://gist.github.com/6fb3e7da327df9203d9d4c184fcb5831
##############################################################################
# Combining Argo CD (GitOps), Crossplane (Control Plane), And Kubevela (OAM) #
# https://youtu.be/eEcgn_gU3SM #
##############################################################################
# Referenced videos:
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
# - Cloud-Native Apps With Open Application Model (OAM) And KubeVela: https://youtu.be/2CBu6sOTtwk
@sindresorhus
sindresorhus / esm-package.md
Last active April 26, 2025 12:29
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
# Source: https://gist.github.com/a156975ae372bf15284e15c489aab4aa
##########################################################################
# Crossplane #
# Using Kubernetes API and GitOps to manage Infrastructure as Code (IaC) #
# https://youtu.be/n8KjVmuHm7A #
##########################################################################
# Referenced videos:
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
@hermanbanken
hermanbanken / kustomize_vars.md
Created November 22, 2020 13:11
Kustomize Vars example

This was initially posted in an kubernetes-sigs/kustomize issue.

We are using Kustomize's vars feature. Initially we didn't understand how to use it for our purpose, but it is a 100% fit. One example is our Ingress resource, which looks like this:

# file: base/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: services

Bootstrap

Init:

gotk bootstrap github \
  --owner=gitopsrun \
  --repository=fleet-infra \
  --branch=main \
  --team=dev \
@Aschen
Aschen / README.md
Last active January 17, 2025 05:31
Benchmarking AsyncLocalStorage

What is the overhead of AsyncLocalStorage?

Run the benchmark:

$ npm i benchmark

# Run the AsyncLocalStorage benchmark
$ node async-local-storage.js ASL
ASL x 15,551 ops/sec ±3.30% (79 runs sampled)