Instantly share code, notes, and snippets.

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'
View assoc.ps1
# MIT license
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"
#!/bin/bash -v
# backing up a vm
cd /media/tim/WD6/
base="/home/tim/VirtualBox VMs"
mv $src.tar.lz4 $src.tar.lz4.old
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:
View profile.ps1
# customized per-user profile
# don't forget to start a new powershell after editing this
# useful things:
# install
# regedit /s solarized-light.reg
# install
# Install-Module posh-git # requires PSGet
View ps-colours.ps1
# output all the colour combinations for text/background
$colors = [enum]::GetValues([System.ConsoleColor])
Foreach ($bgcolor in $colors){
Foreach ($fgcolor in $colors) { Write-Host "$fgcolor|" -ForegroundColor $fgcolor -BackgroundColor $bgcolor -NoNewLine }
Write-Host " on $bgcolor"
View boxstarter2.ps1
# boxstarter script
# source:
# based on:
# tested on win10 x64
# This is a start of a build of a box I'm using at the moment.
# Fork this to your own gist, then comment/uncomment/add stuff to suit you.
# This for a win 10 machine where development will be done in Hyper-V VMs so
# there's no need for dev tools.
View sql layout example.sql
-- Before. Note the tab characters in between the "columns" that we want in the sql text.
-- The tabs have been manually added to tell vim where we want to line things up
-- `:set list` to see tabs in vim
create table HandCraftedSqlTable (
id int identity (1, 1) not null,
parentid int not null,
somename varchar(10) not null,
someothername varchar(65) not null,
somestatus int not null constraint DF_table_tabletatusID default (1),
somereallylongcolumnname varchar(255) null,