Skip to content

Instantly share code, notes, and snippets.

@danrspencer
danrspencer / createTestStore.js
Last active January 14, 2019 11:20
Redux Test Store
export const createTestStore = (
reducer,
initialState = {},
path = [],
thunkArguments = {}
) => {
const stateHistory = [];
const dispatchHistory = [];
const logHistory = store => next => action => {
@danrspencer
danrspencer / get-spec.sh
Created May 4, 2021 11:02
Extract and fully expand a Kubernetes definition
#!/bin/bash
trap "kill 0" EXIT
# Setup the proxy and wait for it to connect
kubectl proxy &
timeout 10s bash -c "until curl http://127.0.0.1:8001/; do sleep 1; done"
# Grab the Kubernetes openapi schema from the API
SCHEMA=$(curl http://127.0.0.1:8001/openapi/v2)
@danrspencer
danrspencer / .zshrc
Last active January 11, 2023 15:35
Bash Scratch
function scra {
FILE=/tmp/scratch-`uuidgen`.sh
echo '#!/bin/bash' > ${FILE}
chmod +x ${FILE}
code ${FILE}
ls ${FILE} | entr ${FILE}
}
export -f scra > /dev/null
import {
DefineFunction,
DefineType,
Schema,
SlackFunction,
} from "deno-slack-sdk/mod.ts";
export const AlertCustomType = DefineType({
name: "Alert",
type: Schema.types.object,