I hereby claim:
- I am jermdavis on github.
- I am jermdavis (https://keybase.io/jermdavis) on keybase.
- I have a public key ASBCmmvpawRgYxXAmGg-piQyK4YuE-VmHghwBDPTQGRWuAo
To claim this, I am signing this object:
using System; | |
using System.Threading; | |
public class FunctionScheduler | |
{ | |
private int _runEveryMs; | |
private Action _actionToRun; | |
private Timer _timer = null; | |
private object _lock = new object(); |
<%@ 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"> |
using System; | |
namespace LoggingPipeline | |
{ | |
public interface IPipelineStep<INPUT, OUTPUT> | |
{ | |
OUTPUT Process(INPUT input); | |
} | |
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; |
## | |
## private functions | |
## | |
# | |
# If necessary, download a file and unzip it to the specified location | |
# | |
function downloadAndUnzipIfRequired | |
{ | |
Param( |
[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, |
function Write-EmbeddedFile | |
{ | |
param | |
( | |
[string]$base64, | |
[string]$targetFile | |
) | |
process | |
{ | |
$Content = [System.Convert]::FromBase64String($base64) |
I hereby claim:
To claim this, I am signing this object:
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}"); | |
} |
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}"); | |
} |