Skip to content

Instantly share code, notes, and snippets.

View timabell's full-sized avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
# erd for https://github.com/DFE-Digital/early-careers-framework/
# view: https://dreampuf.github.io/GraphvizOnline/?url=https://gist.githubusercontent.com/timabell/d12c9cde5f88ef618d03d7aacb84b7e7/raw/f2e4105632d8612484058b6366679cdc851f89ee/entity-relationship-diagram.dot
# dot source: https://gist.github.com/timabell/d12c9cde5f88ef618d03d7aacb84b7e7
# to regenerate this:
# - checkout branch `entity-relationship-diagram-outputs`
# - rebase on `develop`
# - `bundle`
# - `bundle exec erd --filetype=dot`
# - upload `tmp/entity-relationship-diagram.dot` to gist
# - link to gist with `https://dreampuf.github.io/GraphvizOnline/?url=`+your url
#!/bin/bash
# Clear older photos and videos of android phone.
# Combined with https://syncthing.net/
# Howto:
#
# *Warning* make sure you have good backups and multiple copies of things first!
#
# 1) Install synthing on the phone and a laptop. Configure sync of at least DCIM folder.
@timabell
timabell / json-irb.rb
Last active November 18, 2020 10:38
Load a json file into an interactive ruby session https://twitter.com/tim_abell/status/1329010829874827265?s=20
#!/usr/bin/env ruby
require "json"
require "pry"
def load_json filename
puts "parsing #{filename} ..."
file = File.read filename
json = JSON.load file
puts "#{json.length} records loaded"
@timabell
timabell / .gitignore
Last active July 27, 2020 13:57
live reloading graphviz editing
out.svg
@timabell
timabell / combine-cycliq.sh
Last active May 16, 2020 18:07
combine cycliq videos on a linux commandline
# 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
using System;
using System.Linq.Expressions;
using Microsoft.Extensions.Logging;
using Moq;
using Moq.Language.Flow;
namespace YourProject.Unit.Tests
{
internal static class MockHelper
{
{
"$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 November 11, 2019 15:27
simple azure ARM template for schema explorer docker image. Newer version: https://gist.github.com/timabell/ad51ef7ab1525ad2c4d929f427c535df
{
"$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"
},
@timabell
timabell / show.sh
Last active October 21, 2019 15:34
#!/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
@timabell
timabell / heresy.c
Created September 10, 2019 13:09 — forked from tvararu/heresy.c
//
// Compile with:
// gcc -std=c99 heresy.c
//
// Run with:
// ./a.out
//
// It outputs:
// 0
//