Skip to content

Instantly share code, notes, and snippets.


Charles Roper charlesroper

View GitHub Profile
charlesroper / All non-FSC users not enrolled on any courses.sql
Created Oct 13, 2020
All non-FSC users not enrolled on any courses
View All non-FSC users not enrolled on any courses.sql
mdl_user u
LEFT JOIN mdl_user_enrolments e ON = e.userid
LEFT JOIN mdl_role_assignments a ON = a.userid
charlesroper / responsive-youtube.html
Last active Aug 22, 2020
Responsive YouTube embed
View responsive-youtube.html
- Replace the standard domain with for enhanced performance and privacy
- Add ?rel=0 to the end of the URL to remove suggested videos
<div class="embed-responsive embed-responsive-16by9">
<iframe src=""
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
charlesroper / responsive-vimeo.html
Last active Aug 24, 2020
Responsive Vimeo embed
View responsive-vimeo.html
Replace "" with the URL from the default embed code
<div class="embed-responsive embed-responsive-16by9">
<iframe src=""
allow="autoplay; fullscreen"


Via Chocolatey:

choco install fileoptimizer -y

Via Scoop:

scoop install fileoptimizer

charlesroper / windows_terminal.reg
Last active Feb 17, 2020
Windows Terminal Here (add Windows Terminal to Explorer right-click menu)
View windows_terminal.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Windows Terminal [PS]]
[HKEY_CLASSES_ROOT\Directory\Background\shell\Windows Terminal [PS]\command]
@="\"C:\\Users\\Charles\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\Windows Terminal [PS]]
charlesroper / gist:f2da6152d6789fa6f25e9d194a42b889
Last active Aug 19, 2019
How to setup a practically free CDN
View gist:f2da6152d6789fa6f25e9d194a42b889

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2


I'm doing a training course at work and promised I would list some of the books on progressive leadership I have found useful. Here they are in alphabetical order.

Creativity Inc. by Ed Catmull

I love Pixar movies. They have so very rarely fallen below the benchmark of excellent. Not only are they classic stories in their own right, they are also technical marvels. How does an organisation like Pixar maintain such a successful track record? How does it manage to be hugely commercially successful and critically acclaimed, too? Few studios can lay claim to staying so true to their art, especially when the stakes are so high, with the contemporary movies having typically having a budget in excess of $200 million. In this book, Ed Catmull explains how.

One of my favourite chapters, The Hungry Beast and the Ugly Baby, tells of how Pixar has to carefully balance the tension of feeding the "hungry beast" (that is, keeping the business going) with the need to generate and try new ideas, that enter the world a

View partial.cshtml
@inherits UmbracoViewPage<IRelatedLinks>
var linkCards = Model.LinkCards;
var linkCardsAreEnabled = Model.RelatedLinksEnabled;
if (linkCards == null || !linkCardsAreEnabled)
linkCards = Model.Parent.GetPropertyValue<IEnumerable<IPublishedContent>>("linkCards", true);
linkCardsAreEnabled = Model.Parent.GetPropertyValue<bool>("relatedLinksEnabled", true);
charlesroper / 99BottlesCSharpTest.cs
Created Apr 27, 2017
Tests for 99 Bottles of Beer song
View 99BottlesCSharpTest.cs
using Xunit;
public class BeerSongTest
public void First_generic_verse()
var expected =
"99 bottles of beer on the wall, 99 bottles of beer.\n"+
"Take one down and pass it around, 98 bottles of beer on the wall.\n"+
You can’t perform that action at this time.