Skip to content

Instantly share code, notes, and snippets.

View mwoodbri's full-sized avatar

Mark Woodbridge mwoodbri

View GitHub Profile
@mwoodbri
mwoodbri / main.js
Created June 1, 2016 12:51
xero-quickstart
var consumer_key = '...';
var request = require('request').defaults({
oauth: {
consumer_key: consumer_key,
token: consumer_key,
signature_method : 'RSA-SHA1',
private_key: require('fs').readFileSync('privatekey.pem')
},
json: true
});
{
url: 'https://api-partner.network.xero.com/oauth/AccessToken',
oauth: {
signature_method,
consumer_key,
private_key,
token,
session_handle
},
key,
@mwoodbri
mwoodbri / install-mridb.sh
Last active February 28, 2018 14:29
MRIdb installation script for EL6
#!/bin/sh
set -exo pipefail
curl -L https://imperialcollegelondon.box.com/shared/static/wm84f86ikub5mceibprp61cd7jxwanzp.gz | tar xz -C /opt
if [ -f /opt/mridb/conf/application-site.conf ]; then
echo "Updated MRIdb: $(cat /opt/mridb/VERSION)"
exit
fi
@mwoodbri
mwoodbri / install-mridb.sh
Last active March 13, 2018 17:53
MRIdb installation script for EL7
#!/bin/sh
set -exo pipefail
curl -L https://imperialcollegelondon.box.com/shared/static/wm84f86ikub5mceibprp61cd7jxwanzp.gz | tar xz -C /opt
if [ -f /opt/mridb/conf/application-site.conf ]; then
echo "Updated MRIdb: $(cat /opt/mridb/VERSION)"
exit
fi
@mwoodbri
mwoodbri / pre-commit
Created May 14, 2020 11:22
Git hook that warns of non-https links in Markdown files
#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.md" | sed 's| |\\ |g')
test -z "$FILES" && exit 0
URLS=$(echo "$FILES" | xargs egrep -o 'http://[^ )]+')
test -z "$URLS" && exit 0
echo -e "\e[31mInsecure links:\e[0m\n$URLS"
#exit 1
@mwoodbri
mwoodbri / http-link-warning.js
Created May 19, 2020 10:06
Custom rule for markdownlint that disallows non-https links