This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Statiq.App; | |
using Statiq.Common; | |
using StatiqGenerator.Customisations.ReadingTime; | |
namespace StatiqGenerator.Customisations.DisappearingLinks | |
{ | |
public class ExpiringLinkConfigurator : IConfigurator<Bootstrapper> | |
{ | |
public void Configure(Bootstrapper configurable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -RunAsAdministrator | |
param( | |
[string]$dockerEnginePath = "C:\", | |
[string]$dockerInstallPath = "C:\Docker", | |
[string]$dockerEngineUrl = "https://download.docker.com/win/static/stable/x86_64/docker-20.10.8.zip", | |
[string]$dockerZip = "docker.zip", | |
[string]$serviceName = "docker", | |
[string]$composeEngineUrl = "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Windows-x86_64.exe", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task Main() | |
{ | |
var pipeline = new ExampleAsyncPipeline(); | |
var uri = new Uri("https://news.bbc.co.uk/"); | |
var tempFile = await pipeline.ProcessAsync(uri); | |
Console.WriteLine($"{uri} saved to {tempFile}"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task Main() | |
{ | |
var pipeline = new ExampleAsyncPipeline(); | |
var uri = new Uri("https://news.bbc.co.uk/"); | |
var tempFile = await pipeline.ProcessAsync(uri); | |
Console.WriteLine($"{uri} saved to {tempFile}"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Write-EmbeddedFile | |
{ | |
param | |
( | |
[string]$base64, | |
[string]$targetFile | |
) | |
process | |
{ | |
$Content = [System.Convert]::FromBase64String($base64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding(SupportsShouldProcess=$True)] | |
param( | |
# What .tar.gz file should be extracted? Must exist. | |
[Parameter(Mandatory=$True)] | |
[string]$FileToExtract, | |
# What folder should the files be extracted into? Does not need to exist | |
[Parameter(Mandatory=$True)] | |
[string]$TargetFolder, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## private functions | |
## | |
# | |
# If necessary, download a file and unzip it to the specified location | |
# | |
function downloadAndUnzipIfRequired | |
{ | |
Param( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Either<SUCCESS, FAILURE> | |
{ | |
private readonly bool _isSuccess; | |
private readonly SUCCESS _success; | |
private readonly FAILURE _failure; | |
public bool IsSuccess => _isSuccess; | |
public bool IsFailure => !IsSuccess; | |
public SUCCESS SuccessValue => _success; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace LoggingPipeline | |
{ | |
public interface IPipelineStep<INPUT, OUTPUT> | |
{ | |
OUTPUT Process(INPUT input); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page language="c#" enableeventvalidation="false" autoeventwireup="true" enableviewstate="false" %> | |
<%@ import namespace="System.Security.Permissions" %> | |
<%@ import namespace="System.Collections.Generic" %> | |
<%@ import namespace="System.Threading" %> | |
<%@ import namespace="System.Security.Principal" %> | |
<%@ import namespace="Newtonsoft.Json" %> | |
<%@ import namespace="Sitecore.Data.Items" %> | |
<script runat="server"> |
NewerOlder