Skip to content

Instantly share code, notes, and snippets.

View chrishiestand's full-sized avatar

Chris Hiestand chrishiestand

View GitHub Profile
@chrishiestand
chrishiestand / ms-to-utc
Created May 7, 2021 20:59
Bash script to convert milliseconds since epoch to human readable iso-8601 utc time
#!/usr/bin/env bash
millis=${1-}
if [ -z "$millis" ]; then
script="${0##*/}"
echo "usage: $script milliseconds-since-epoch"
echo "example: $script 1620418406902"
exit 1
fi
@chrishiestand
chrishiestand / ms-to-local
Last active May 7, 2021 20:59
Bash script to convert milliseconds since epoch to human readable iso-8601 local time
#!/usr/bin/env bash
millis=${1-}
if [ -z "$millis" ]; then
script="${0##*/}"
echo "usage: $script milliseconds-since-epoch"
echo "example: $script 1620418406902"
exit 1
fi
@chrishiestand
chrishiestand / dgraph-badger-subscription-poc.go
Created March 3, 2020 22:07
Playing around with badger subscription
package main
import (
"context"
"fmt"
"log"
badger "github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/pb"
)

Problem

How can I use the js client side api to satisfy the stripe custom connect requirement of "individual.verification.additional_document"?

Context

The js client is handling the file upload and account token creation. The token ID is passed to the server where the server-side stripe api is used to update the account. This works perfectly to verify the custom connect requirement: "individual.verification.document", but not "individual.verification.additional_document"

This is in stripe test mode and the file being uploaded is this: https://stripe.com/img/docs/connect/success.png

" )26" contains illegal characters
   at Http2CallStream.<anonymous> (/app/node_modules/@grpc/grpc-js/build/src/client.js:102:45)
   at Http2CallStream.emit (events.js:205:15)
   at Http2CallStream.EventEmitter.emit (domain.js:471:20)
   at Http2CallStream.endCall (/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:74:18)
   at ClientHttp2Stream.<anonymous> (/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:205:30)
   at ClientHttp2Stream.emit (events.js:200:13)
   at ClientHttp2Stream.EventEmitter.emit (domain.js:471:20)
 at emit (internal/http2/core.js:247:8)
@chrishiestand
chrishiestand / jumpjob.yaml
Last active August 22, 2018 20:58
Jumpjob: Get a psuedo-shell on a kubernetes node via a pod.
# Usage:
# kubctl apply -f jumpjob.yaml
# Wait until pod is running and then:
# kubectl exec -it $(kubectl get pod -l job-name=jumpjob -o jsonpath='{.items[0].metadata.name}') /bin/bash
apiVersion: batch/v1
kind: Job
metadata:
name: jumpjob
spec:
template:
#!/bin/bash
# iBeacon Scan by Radius Networks
if [[ $1 == "parse" ]]; then
packet=""
capturing=""
count=0
while read line
do
count=$[count + 1]
@chrishiestand
chrishiestand / pyramid.go
Created October 13, 2017 03:43 — forked from triztian/pyramid.go
SDGophers Meetup 2017-10-12 Challenge
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"sort"
"strconv"
"strings"
@chrishiestand
chrishiestand / kube-get-secret.sh
Last active October 6, 2017 22:19
shortcut bash script to read a remote kubernetes secret and output to terminal
#!/usr/bin/env bash
# works on OS X
# requires jq to be installed eg: `brew install jq`
# can be easily modified to run in linux or both linux and os x
set -euo pipefail
IFS=$'\n\t'
context="${1-}"
apiVersion: v1
kind: Pod
metadata:
name: sysctl-buddy
spec:
containers:
- image: alpine
command:
- /bin/sh
args: