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 / 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)"
@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 \