This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Compile with: | |
// gcc -std=c99 heresy.c | |
// | |
// Run with: | |
// ./a.out | |
// | |
// It outputs: | |
// 0 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# multi-repo setup for DfE BAT Find | |
# https://github.com/webreactor/docker-project | |
version: "3.2" | |
volumes: | |
dbdata: | |
services: | |
scdb: | |
image: postgres:9.6-alpine | |
# To preserve data between runs of docker-compose, we mount a folder from the host machine. | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old_provider = Provider.find_by(provider_code: '1QQ') | |
new_provider = Provider.find_by(provider_code: '28Y') | |
old_provider.sites.each { |site| site.provider = new_provider; site.save } | |
old_provider.courses.each { |course| course.provider = new_provider; course.save } | |
old_provider.organisations = [] | |
old_provider.enrichments.each { |enrichment| enrichment.destroy } | |
old_provider.destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" ./test-ucas-endpoint.py | |
# https://gist.github.com/timabell/16926c828ca33a178f0f0adc5dae4f76 | |
# MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://schemaexplorer.io/ | |
# This file configures which columns will be loaded from the other side of a foreign key. | |
# Place this file in folder `config` next the schema explorer executable and name it peek-config.txt, or use the `-peek-config-file` option to pass the path to it. | |
# Lines starting with # will be ignored along with blank lines. | |
# Names are lowercased before matching so make sure your all your regexes below are entirely lowercase otherwise they won't match. | |
# Each line is a golang regex https://golang.org/pkg/regexp/ 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-02-07T15:29:46.603Z","extensionVersion":"v3.2.4"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://gist.github.com/timabell/b501a4ef5c6fddebe629c15f002cc649 | |
-- for the database generated by https://github.com/DFE-Digital/manage-courses-api | |
SELECT * FROM mc_user WHERE email like '%abell%'; | |
SELECT * FROM mc_organisation_user WHERE email like '%abell%'; | |
-- all the related tables | |
select u.email, ui.inst_full, * | |
from mc_user u, mc_organisation_user ou, mc_organisation_institution oi, ucas_institution ui | |
where | |
--ou.org_id = '5606' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/timabell/bc90e0808ec1cda173ca09225a16e194 | |
# MIT license | |
$exts=@( | |
"csv", | |
"csproj", | |
"json", | |
"log", | |
"md", | |
"patch", | |
"sql", |