Skip to content

Instantly share code, notes, and snippets.

418 I'm a teapot

Tim Abell timabell

418 I'm a teapot
Block or report user

Report or block timabell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
timabell /
Last active Mar 12, 2019
Quick script for test the provider/course api exposed by
#!/usr/bin/env python
# iterate through providers
# usage, env vars to override defaults:
# token=authtoken urlbase="http://someserver/" endpoint="api/v1/2019/providers" startat="?changed_since=2019-03-11T15%3A47%3A57.548105Z&per_page=100" ./
# MIT License
View fix-seq.sql
ALTER SEQUENCE mc_organisation_id_seq RENAME TO organisation_id_seq;
ALTER TABLE organisation ALTER id SET DEFAULT nextval('organisation_id_seq'::regclass);
ALTER SEQUENCE mc_organisation_institution_id_seq RENAME TO organisation_provider_id_seq;
ALTER TABLE organisation_provider ALTER id SET DEFAULT nextval('organisation_provider_id_seq'::regclass);
ALTER SEQUENCE mc_organisation_user_id_seq RENAME TO organisation_user_id_seq;
ALTER TABLE organisation_user ALTER id SET DEFAULT nextval('organisation_user_id_seq'::regclass);
ALTER SEQUENCE "UcasInstitutions_Id_seq" RENAME TO provider_id_seq;
timabell / make-fks.sql
Created Feb 10, 2019
magic up foreign keys for sql server based on naming heuristics
timabell / peek-config.txt
Last active Jan 23, 2019
An idea for a default peek configuration for
View peek-config.txt
# This file configures which columns will be loaded from the other side of a foreign key.
# Place this file next the schema explorer executable and name it peek-config.txt
# Lines starting with # will be ignored along with blank lines.
# Each line is a golang regex that will be matched against schema.table.column, (table.column for sqlite)
# schema/table/column names are converted to lower-case before comparing with the below regexes
# Customise this file to suit your database (but make sure you keep your copy when upgrading schema explorer).
View cloudSettings
View manage-courses-test-users.sql
-- for the database generated by
SELECT * FROM mc_user WHERE email like '%abell%';
SELECT * FROM mc_organisation_user WHERE email like '%abell%';
-- all the related tables
select, ui.inst_full, *
from mc_user u, mc_organisation_user ou, mc_organisation_institution oi, ucas_institution ui
--ou.org_id = '5606'
timabell / assoc.ps1
Last active Feb 11, 2019
set windows file associations
View assoc.ps1
# MIT license
timabell /
Created Apr 3, 2018
metro bank export to ynab import converter
for x in *.csv; do
echo "$x"
cp "$x" "$x.orig"
sed -i '1c Date,Payee,Memo,Money In, Money Out,Balance' "$x"
# remove stupid date from start of tx description. fucking idiots.
sed -i 's/,[0-9][0-9] [A-Z][A-Z][A-Z] [0-9][0-9] /,/g' "$x"
timabell /
Last active Apr 25, 2019
tar+lz4 backup with progress
#!/bin/bash -v
# backing up a vm
cd /media/tim/WD6/
base="/home/tim/VirtualBox VMs"
mv $src.tar.lz4 $src.tar.lz4.old
timabell / LICENSE
Last active Feb 27, 2017
azure dev vm base
The MIT License (MIT)
Copyright (c) 2015 Microsoft Azure
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
You can’t perform that action at this time.