This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
DefineFunction, | |
DefineType, | |
Schema, | |
SlackFunction, | |
} from "deno-slack-sdk/mod.ts"; | |
export const AlertCustomType = DefineType({ | |
name: "Alert", | |
type: Schema.types.object, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const createTestStore = ( | |
reducer, | |
initialState = {}, | |
path = [], | |
thunkArguments = {} | |
) => { | |
const stateHistory = []; | |
const dispatchHistory = []; | |
const logHistory = store => next => action => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --grep "##regex##" --basic-regexp --pretty=format:%h | xargs -I '{}' open https://github.com/danrspencer/repo/commit/'{}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const update = (lensGenerator, func) => (state, payload) => | |
over( | |
lensGenerator(payload), | |
obj => ({ ...obj, ...func(payload, obj, state) }), | |
state | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git config user.email "[email protected]" | |
git filter-branch -f --env-filter ' | |
NAME="Dan Spencer" | |
EMAIL="[email protected]" | |
if [ "$GIT_COMMITTER_NAME" = "$NAME" ] | |
then | |
export GIT_COMMITTER_EMAIL="$EMAIL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const compose = (...fns) => | |
fns.reduce((f, g) => (...args) => f(g(...args))); | |
export const pipe = (...fns) => compose.apply(compose, fns.reverse()); | |
export const partial = (fn, [args]) => (...moreArgs) => | |
fn(...[args, ...moreArgs]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function curry(func, ...args) { | |
return (...moreArgs) => func(...args, ...moreArgs); | |
} | |
const target = (a, b, c, d, e) => a+b+c+d+e; | |
const abTarget = curry(target, "a", "b"); | |
const abcdTarget = curry(abTarget, "c", "d"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Setup the dev volume: https://brianboyko.medium.com/a-case-sensitive-src-folder-for-mac-programmers-176cc82a3830 | |
set -e | |
# Install Brew | |
# https://brew.sh | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
NewerOlder