Skip to content

Instantly share code, notes, and snippets.

View matt-forster's full-sized avatar
🚀

Matt Forster matt-forster

🚀
View GitHub Profile
@matt-forster
matt-forster / strategy.js
Created January 26, 2016 16:52
Framework implementation of the Strategy Design pattern.
import fs from 'fs';
/*
Maintains three different strategies to mix and
match solutions for different and changing manufacturer
requirements
*/
// Abstract Parsing Strategy
class AbstractParse {
@matt-forster
matt-forster / GitHub curl.sh
Last active June 29, 2016 21:17 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
PATH="scripts/build/tabloid.sh"
FILE="https://api.github.com/repos/$OWNER/$REPO/contents/$PATH"
curl --header "Authorization: token $TOKEN" \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
@matt-forster
matt-forster / get_file.sh
Created August 30, 2016 18:16
Get a file from a repo on github - used in CI.
# Get a file from a repo on github
TOKEN=$GITHUB_TOKEN
OWNER=$1
REPO=$2
PATH=$3
FILE="https://api.github.com/repos/$OWNER/$REPO/contents/$PATH"
/usr/bin/curl -v --header "Authorization: token $TOKEN" \
--header 'Accept: application/vnd.github.v3.raw' \
@matt-forster
matt-forster / keybase.md
Created April 6, 2017 18:15
keybase.md

Keybase proof

I hereby claim:

  • I am forstermatth on github.
  • I am forstermatth (https://keybase.io/forstermatth) on keybase.
  • I have a public key ASAUIMLwibEe4kHYjPJSOkgqnQFi9cqNIYoWE3CcWoRsiwo

To claim this, I am signing this object:

@matt-forster
matt-forster / time.sh
Last active October 21, 2021 20:27 — forked from trs/time.sh
Run `EXPLAIN ANALYZE` on a given query multiple times, output the average planning and execution times
#!/bin/bash
# Usage
# time.sh "$(r2 creds -e staging --bare)" "$(cat query.sql)" 10
creds="$1"
query="$2"
count="${3:-10}"
out="$(mktemp)"
sequenceDiagram
    GRPC Client->>+Service: Request
    
    par Task Queue
        Service--)Temporal: Execute Workflow Definition
        Note over Service,Temporal: Cached: Workflow Parameters
        Temporal-)+Worker One: Start Workflow Execution
    end
 par Task Queue