I hereby claim:
- I am 15joeybloom on github.
- I am jbloom (https://keybase.io/jbloom) on keybase.
- I have a public key ASBFgaU0CvyTKzGpAI3BcJ7CSa4l5-Q7K3yA_VOAoTldRAo
To claim this, I am signing this object:
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| ) | |
| func isValidSiteswap(pattern []int) error { | |
| total := 0 | |
| numBeats := 0 |
| // Takes a structure with possible circular references, e.g. | |
| // functions.https.CallableContext, and truncates it to finite depth. | |
| function finiteDepth(x: any, depth: bigint): any { | |
| if (depth <= 0) { | |
| return "Truncated by finiteDepth" | |
| } else if (x instanceof Array) { | |
| return x.map(e => finiteDepth(e, depth - 1n)) | |
| } else if (typeof x === 'object' && x !== null) { | |
| return Object.fromEntries( | |
| Object.entries(x).map( |
| ;; https://github.com/green-coder/transducer-exercises | |
| (ns transducers) | |
| ;; We use this function instead of `into` for debugging. | |
| ;; The reason is that this avoids using transient | |
| ;; structures which do not `print` nicely. | |
| (defn slow-into [to xf from] | |
| (transduce xf conj to from)) | |
| (def identity-transducer |
| # https://gist.github.com/15joeybloom/3a24c60b191836deed144c760a0799e0 | |
| aws_profile_prompt() { | |
| if [ -z "${AWS_PROFILE+foo}" ] ; then # Check if AWS_PROFILE set | |
| printf "" | |
| elif [ -z "$AWS_PROFILE" ] ; then # Check if AWS_PROFILE empty | |
| # italic, red bg, black fg | |
| printf "\001\033[3;48;5;1;38;5;16m\002AWS Profile empty!\001\033[0m\002 " | |
| else | |
| # bold, yellow bg, black fg | |
| printf "\001\033[1;48;5;220;38;5;16m\002AWS Profile: $AWS_PROFILE\001\033[0m\002 " |
I hereby claim:
To claim this, I am signing this object: