Skip to content

Instantly share code, notes, and snippets.

Charles Roper charlesroper

View GitHub Profile


Via Chocolatey:

choco install fileoptimizer -y

Via Scoop:

scoop install fileoptimizer

charlesroper / cf-update-dns-txt.ps1
Last active Apr 9, 2020
PowerShell script to update the _acme-challenge TXT entry on CloudFlare
View cf-update-dns-txt.ps1
# See for background
# Could be enhanced by putting YOUR_CF_API_KEY and YOUR_EMAIL in environment vars
# Usage:
# > cf-update-dns-txt.ps1 -Domain -Value vNx_fpLgvq0l4rqSATuxhxl9pa155SoeKvNZ98AFB_4
param( [string]$domain, [string]$value )
$headers = @{
"X-Auth-Key" = "YOUR_CF_API_KEY"
"X-Auth-Email" = "YOUR_EMAIL"
"Content-Type" = "application/json"

The Last Boy Scouts

Early History

Back in November 2000 a trio of new-to-the-scene Counter-Strike players decided it was time to start their own clan. Despite one of the three still preferring TFC (ahem Hal cough) they successfully devised a concept for, and launched The Last Boy Scouts.

The name comes from the eponymous film, which we had probably just watched. We don't remember. What we do know is that it's still a damn fine action movie with some great one-liners. Check it out if you haven't already. Don't be put off by the reviews - The Last Boy Scout is nothing more than lovable trash. A Bit like us.

When those three players renamed themselves after characters from the film: Jimmy Dix, Hallenbeck and Milo, clan LBS was born.

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

charlesroper / tmsanitize4e.rb
Created Aug 12, 2009
A script to fix filenames that are incompatible with Windows.
View tmsanitize4e.rb
# tmsanitize4e.rb
# A script to sanitize filenames that are incompatible with Windows.
require 'uri'
require 'find'
require 'fileutils'
include FileUtils::Verbose
charlesroper / 1. input.scss
Created Jul 29, 2011
Responsive Web Design with Sass (SCSS syntax)
View 1. input.scss
@function pxem($pxval, $base: 16px) {
// Function to take a pixel value and divide it by a base value in order to
// return the size in ems. Default base value is 16px
@return ($pxval / $base) * 1em; // multiply by 1em to convert px to ems.
body {
background-color: #DCDBD9;
color: #2C2C2C;
font: normal 100% Cambria, Georgia, serif;
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);
You can’t perform that action at this time.