Skip to content

Instantly share code, notes, and snippets.

View Noxsios's full-sized avatar

razzle Noxsios

View GitHub Profile
@Noxsios
Noxsios / create-doug-user.go
Last active April 8, 2025 22:41
create doug user
// This example is a naive translation of the shell task into Go,
// there are many optimizations + reuse needed before this would be fully accepted as a builtin
// + unit tests
// BuiltinSetupDougUser sets up a doug user in Keycloak
type BuiltinSetupDougUser struct {
KeycloakGroup string `json:"keycloak_group,omitempty" jsonschema:"description=Optional Keycloak group to add the user to"`
}
func (b BuiltinSetupDougUser) Execute(ctx context.Context) error {
@Noxsios
Noxsios / simple.test.ts
Created March 27, 2025 15:10
Playwright + KFC
import { expect } from "@playwright/test"
import { test } from "../../../e2e"
import { K8s as k, kind } from "kubernetes-fluent-client"
test("has title", async ({ page, pkg }) => {
await page.goto("/")
const ns = pkg.components.at(0)?.charts?.at(0)?.namespace || ""
expect(ns).toBeTruthy()
@Noxsios
Noxsios / flash.md
Last active October 16, 2024 01:42
import io.grpc.ManagedChannelBuilder
import io.grpc.stub.StreamObserver
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.apache.commons.compress.archivers.tar.TarArchiveEntry
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream
import java.io.*
import java.nio.file.Files
import java.nio.file.Path
--- main.go ---
type Lease struct {
AccountID string
}
type PageData struct {
Leases []Lease
AvailableAccounts []string
}
#!/bin/bash
# Directory containing the Go files
DIRECTORY="."
# Array of paths to exclude from the check
EXCLUDE_PATHS=(
"./path/to/directory/exclude1"
"./path/to/directory/exclude2"
)
func (p *Packager) updateComponentImagesInplace(index int, images []string, cm goyaml.CommentMap) error {
component := p.cfg.Pkg.Components[index]
for imageIdx, image := range component.Images {
commentsPath := fmt.Sprintf("$.components[%d].images[%d]", index, imageIdx)
imageComments := cm[commentsPath]
left, err := transform.ParseImageRef(image)
if err != nil {
return err

Brewfile explained

My current Brewfile explained. Some entries (like gcc) are omitted because they are self explanatory, while others (like helm) are omitted because they are much more commonly known. This leaves, lesser known and hopefully helpful programs. Enjoy!

For all my tools I like using the macchiato color scheme from catpuccin

// Inspired by https://github.com/hugomd/parrot.live
// This runs in a Cloudflare worker.
const brown = "\u001b[38;5;94m";
const green = "\u001b[38;5;28m";
const reset = "\u001b[0m";
const frames = [
`
::::::::::::
@Noxsios
Noxsios / Write-Typewriter.ps1
Created July 25, 2021 20:20
Fancy typewriter function to add flair to Write-Host
function Write-Typewriter {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
[string]$Text,
[Parameter()]
[ConsoleColor]$Color = [ConsoleColor]::Green,
[Parameter()]
[int]$Delay = 200,
[Parameter()]