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
timabell / combine-cycliq.sh
Last active May 16, 2020
combine cycliq videos on a linux commandline
View combine-cycliq.sh
# https://gist.github.com/timabell/26716d7773b61d7b586c5a1babe8fb28
# make a picture in picture video from multiple front/back camera chunked video files
# expects files in folders `front/` and `back/`
mkdir -p output
# front
# concat file chunks together https://trac.ffmpeg.org/wiki/Concatenate
ls front/*.MP4 | awk '{print "file " "'\''" $0 "'\''"}' | tee front-files.txt
ffmpeg -f concat -i front-files.txt -c copy -flags +global_header -acodec libvo_aacenc output/front.mp4
View LogMockHelper.cs
using System;
using System.Linq.Expressions;
using Microsoft.Extensions.Logging;
using Moq;
using Moq.Language.Flow;
namespace YourProject.Unit.Tests
{
internal static class MockHelper
{
View schema-explorer-parameters.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceEnvironmentName": {
"value": ""
},
"customHostName": {
"value": ""
},
@timabell
timabell / schema-explorer-parameters.json
Last active Nov 11, 2019
simple azure ARM template for schema explorer docker image. Newer version: https://gist.github.com/timabell/ad51ef7ab1525ad2c4d929f427c535df
View schema-explorer-parameters.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"containerName": {
"value": "s121d01-schema-explorer-test"
},
"location": {
"value": "westeurope"
},
View show.sh
#!/bin/bash -v
# local version of:
# http://deckdown.org/deck?theme=solarized&src=https://gist.githubusercontent.com/timabell/55ebbab29ea123c17f192bdbdec5aa44/raw/whats-a-db.md#/2
pushd .
cd ~/repo/deckdown
PORT=3002 node deckdown.js &
pid[0]=$!
popd
View heresy.c
//
// Compile with:
// gcc -std=c99 heresy.c
//
// Run with:
// ./a.out
//
// It outputs:
// 0
//
View docker-compose.yml
# 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:
View provider-merge.rb
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
@timabell
timabell / test-ucas-endpoint.py
Last active Mar 12, 2019
Quick script for test the provider/course api exposed by https://github.com/DFE-Digital/manage-courses-backend/
View test-ucas-endpoint.py
#!/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
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;
You can’t perform that action at this time.