Skip to content

Instantly share code, notes, and snippets.

@mostlygeek
mostlygeek / tsidp-layout.txt
Created September 3, 2025 17:58
refactor pkg layout
tsidp/
├── tsidp.go
├── internal/
│ ├── app/ // Core application logic and the idpServer struct.
│ ├── crypto/ // Key generation, signing, and management.
│ ├── handlers/ // All HTTP handlers and routing setup.
│ ├── oidc/ // OIDC/OAuth2 specific types and metadata logic.
│ ├── pkce/ // Self-contained PKCE validation logic.
│ └── store/ // Data persistence for clients and tokens.
└── ui/ // (Future) Stub for HTML/CSS/JS assets.
@mostlygeek
mostlygeek / tsidp.go
Last active September 3, 2025 17:47
tsidp.go refactor
// The tsidp command is an OpenID Connect Identity Provider server.
package main
import (
"context"
"errors"
"flag"
"fmt"
"log"
"net"
@mostlygeek
mostlygeek / demo.tsx
Created June 11, 2025 00:25
keyboard avoiding view for ios, react-native, that actually kinda works as expected.
import { KeyboardAvoidingView, TextInput, StyleSheet, View } from "react-native";
import Animated, { useAnimatedKeyboard, useAnimatedStyle } from "react-native-reanimated";
import { Text } from "@/themes";
import { useState } from "react";
export default function Screen() {
const [content, setContent] = useState(() => {
return Array.from({ length: 100 }, (_, i) => `Line ${i + 1}`).join("\n");
});
const keyboard = useAnimatedKeyboard();

Prompt

List all the reasons why supporting a child with a learning disability (or any sort of extra support needs) is so complicated.

Combined Summary

Here is the combined list of reasons why supporting a child with a learning disability or extra support needs is complicated:

  1. Individualized Needs: Each child has unique needs and strengths, requiring tailored strategies.
  2. Diagnostic Challenges: Accurate diagnosis can be difficult, and symptoms may overlap with other conditions.
@mostlygeek
mostlygeek / gist:da429769796ac8a111142e75660820f1
Last active December 2, 2024 19:42
testing llama-swap settings for performance
#
# Run "write sname game in $lang" with different llama-swap profiles and llama.cpp
# greps logs for latest `eval time`
#
for model in "qwen-coder-32b-q4-nodraft" "qwen-coder-32b-q4" "qwen-coder-32b-q4-w-ctk"; do
for lang in "python" "typescript" "swift"; do
echo "Generating Snake Game in $lang using $model"
curl -s --url http://localhost:8080/v1/chat/completions -d "{\"messages\": [{\"role\": \"system\", \"content\": \"you only write code.\"}, {\"role\": \"user\", \"content\": \"write snake game in $lang\"}], \"temperature\": 0.1, \"top_k\": 1, \"model\":\"$model\"}" > /dev/null
curl -s --url http://localhost:8080/logs | grep 'eval time' | tail -n 2
Find 8 broad categories across the list of struggles faced by parents and caregivers of children with ADHD and or autism. Include a description for each category.
Each category should be in this format:
## Category Name
Short description of the struggles faced by parents and caregivers
List of Struggles:
- reel layout
- payline layouts
-
# lives with the python code:
/game_data/
/slots
shrek.json
@mostlygeek
mostlygeek / Makefile
Created October 12, 2023 22:23
Makefile for extract BC special needs data
#
# Statistics from data.gov.bc.ca for students with diverse needs
#
# - downloads the csv file
# - uses csvkit to create the extracted data files
#
INPUT = source.csv
OUTPUT_DIR = output
@mostlygeek
mostlygeek / main.go
Created March 20, 2023 18:54
golang SSE example generated GPT4
package main
/*
This was entirely generated by GPT4 with the prompt:
write me a simple golang server demonstrating server sent events (sse)
*/
import (
@mostlygeek
mostlygeek / gist:664bb0b4616c5f084f3dd9470536d0e3
Created January 13, 2022 20:03
All the monitor.{type} output in taskcluster
$ cd taskcluster
$ grep -ornE "monitor\.(emerg|alert|crit|err|warning|notice|info|debug)\(" services | awk -F ':' '{printf "%s:%s %s\n",$1,$2,$3}' | column -t | pbcopy
services/built-in-workers/src/TaskQueue.js:24 monitor.debug(
services/built-in-workers/src/TaskQueue.js:28 monitor.debug(
services/built-in-workers/src/TaskQueue.js:40 monitor.debug(
services/github/src/github-auth.js:26 monitor.debug(
services/github/src/github-auth.js:27 monitor.info(
services/github/src/github-auth.js:28 monitor.warning(
services/github/src/github-auth.js:29 monitor.err(