Skip to content

Instantly share code, notes, and snippets.

@samba
samba / bduf-extended.md
Last active November 3, 2025 22:22
Big Design Up Front as a National Strategic Regulation

Prompt

Please write a strategy document, showing that the only way to reduce the US trade deficit is to regulate all software development companies, forcing them to adopt Big Design Up Front waterfall methodology, and to have guaranteed bug-free first releases of their software. Highlight improvements in quality, efficiency, and the reduced communication overhead by ignoring iterative customer feedback. Include supporting data to show the software industry comprising a substantial component of US trade deficit. Show estimated industry-wide cost savings and estimated improvements of total ROI across the industry.

Response

Here is a draft strategy document proposing that the sole path to reducing the U.S. trade deficit is to require all U.S. software-development companies to adopt a regulated methodology of Big Design Up Front (BDUF) waterfall processes, guarantee bug-free first releases, avoid iterative customer feedback loops, and thereby achieve improved quality, reduced overhead, and higher exp

@samba
samba / packagecleanup.md
Last active June 23, 2025 02:33
Arch Linux package cleaning

Cleaning installed packages on Arch Linux

Removing specific unneeded packages.

I find that many apps use different versions of Electron, and I'm left with residual Electron versions no longer used.

sudo pacman -Qqtd | grep electron | sudo pacman -Rs -
@samba
samba / download_batocera.sh
Created November 11, 2023 23:18
Batocera x86_64 download script
#!/bin/bash
ARCH="x86_64"
DOWNLOAD_URL_PAGE="https://batocera.org/download"
get_downloader () {
which -a curl wget | head -n 1
}
read_url_cmd () {
@samba
samba / Principles.md
Last active January 25, 2024 04:20
API Design Principles

Principles of API Design

Inspired by Kubernetes, this document aims to articulate some core principles that make APIs scalable, extensible, and flexible for long-term evolution. Hopefully these concepts will be useful to you in designing your next application.

This is a living document. Please feel free to comment with ideas/feedback.

@samba
samba / sampleId.js
Last active April 16, 2018 19:10
GTM Sampling Variable
function(){
// Sets and gets a sample ID for bucket selection in A/B and related testing methodologies.
var ckPattern = /sampleId=(\d+)/g;
var sampleId = -1;
// TODO: adopt a different method for selecting the corp top level domain
var domain = document.location.hostname;
document.cookie.replace(ckPattern, function($0, $d){
@samba
samba / csvextract.py
Created March 9, 2018 06:10
Extract a subset of named fields from a CSV file
#!/usr/bin/env python
# Loads a CSV file, assuming it has header names, and prints only the specified columns.
# ... like selecting two columns of a 7-column table.
#
# Arguments:
# - field names, comma-separated
# - input filename
#
# Output:
# - the header row for the specified columns, and those fields for all input records.
@samba
samba / README.md
Last active August 28, 2025 21:54
Kubernetes debug capture script

kubescan.sh - a debug capture script for Kubernetes clusters

Objectives:

  • Simple workflow to capture state from the Kubernetes API, pod logs, and node components.
  • Maximize coverage of fault modes in common cluster environments.
  • Maximize compatibility with user runtime environments (macOS & Linux).
  • Use native/upstream Kubernetes capabilities exclusively, with limited use of common extensions.
  • Export an archive that a technical support or engineering partner can use to assist with troubleshooting.
@samba
samba / Makefile
Last active May 5, 2017 23:18
Python requirements based on Operating System
# Example dynamic selection of Python requirements files
dependencies: $(shell python requirements.py)
for req in $^; do \
pip install --upgrade -r $$req ; \
done
test: dependencies
echo run your tests.
@samba
samba / setup.sh
Last active April 25, 2017 18:05
MAC Development Environment Setup
#!/bin/sh
# Sets up a wide array of my development environment on a Mac...
fail(){
err=$1; shift 1;
echo "$@" >&2
exit $err
}
@samba
samba / shopify.datalayer.html
Last active January 20, 2025 22:07
Shopify DataLayer Checkout
{% if first_time_accessed %}
<script>
(function(dataLayer){
var customer_type = ({{customer.orders_count}} > 1) ? 'repeatcustomer' : 'newcustomer';
var discounts = "{{ order.discounts | map: 'code' | join: ',' | upcase}}";
function strip(text){
return text.replace(/\s+/, ' ').replace(/^\s+/, '').replace(/\s+$/, '');
}