Skip to content

Instantly share code, notes, and snippets.

View mwoodbri's full-sized avatar

Mark Woodbridge mwoodbri

View GitHub Profile
@mwoodbri
mwoodbri / http-link-warning.js
Created May 19, 2020 10:06
Custom rule for markdownlint that disallows non-https links
@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 / 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 / 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
{
url: 'https://api-partner.network.xero.com/oauth/AccessToken',
oauth: {
signature_method,
consumer_key,
private_key,
token,
session_handle
},
key,
@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
});
ADDRESS=10.10.0.2
CLIENT=$(hostname -s)
yum install -y epel-release
yum install -y tinc
mkdir -p /etc/tinc/hosts
cat >/etc/tinc/tinc.conf <<EOF
Name=$CLIENT
ConnectTo=vp1
EOF
tincd -K </dev/null
var request = require('request');
var CONSUMER_KEY = 'YOUR_XERO_CONSUMER_KEY';
var accountCodes = {
eating_out: 420
};
export default async function(hook) {
var transaction = hook.params;
if (/#expenses(?: |$)/.test(transaction.data.notes)) {
hook.res.end();
}
[
{
"company": "Pulselive",
"stand": "64",
"room": "Blue",
"saturday": true,
"sunday": true,
"mission": "We partner with some of the biggest global sports organisations to deliver websites and mobile apps that inform, entertain and engage sports fans."
},
{
@mwoodbri
mwoodbri / chaser
Last active November 23, 2015 22:47
export METEOR_SETTINGS=$(</etc/chaser.json)
export ROOT_URL=http://<HOSTNAME>
export MAIL_URL=smtp://...
export MONGO_URL=mongodb://DBSERVER/meteor
export MONGO_OPLOG_URL=mongodb://DBSERVER/local
export PORT=3000
export HTTP_FORWARDED_COUNT=1
export KADIRA_APP_ID=...
export KADIRA_APP_SECRET=...
node /opt/chaser/main.js