Skip to content

Instantly share code, notes, and snippets.

View bjcull's full-sized avatar
💲
Helping people get paid

Ben Cull bjcull

💲
Helping people get paid
View GitHub Profile
@bjcull
bjcull / Install-Seq.ps1
Last active June 21, 2023 06:00 — forked from dennisroche/Install-Seq.ps1
Download and install Seq (https://getseq.net/). Can be used by Azure Resource Manager template. Use RawGit to access the file with proper Content-Type headers - https://rawgit.com/
[CmdletBinding()]
param (
[string]$SeqVersion,
[string]$SeqPort
)
$installBasePath = "C:\Install\"
$global:seqDataPath = "C:\ProgramData\Seq"
function Write-Log
@bjcull
bjcull / TimeService.cs
Created November 27, 2017 09:00
The current time service I use to keep track of dates relative to a certain timezone.
public class TimeService : ITimeService
{
private readonly ILogger _logger;
private Instant? _frozenTime;
private Instant _realTimeAtTimeOfFreezing = Instant.MinValue;
private readonly IDateTimeZoneProvider _timeZoneProvider = DateTimeZoneProviders.Tzdb;
private readonly DateTimeZone _timeZone;
public TimeService(ILogger logger, string systemTimeZone, DateTime? setDate = null)
public static class AsExpandableExtension
{
public static IQueryable<T> AsExpandable<T>(this IQueryable<T> source)
{
if (source is ExpandableQuery<T>)
{
return (ExpandableQuery<T>)source;
}
@bjcull
bjcull / AddAllClaimAction.cs
Last active May 18, 2018 14:05
Adds all custom claims to the asp.net core identity
public class AddAllClaimAction : ClaimAction
{
public AddAllClaimAction() : base(null, null)
{
}
public override void Run(JObject userData, ClaimsIdentity identity, string issuer)
{
var claims = userData.Properties()
.Where(x => !x.Value.HasValues)
@bjcull
bjcull / paymentsInProcess.qry
Created March 29, 2019 04:32
SQL Output for my perhaps not so efficient query
DECLARE @__submerchantId_0 int = 147;
DECLARE @__startDateLocal_Value_1 datetime2(7) = '2019-01-25';
DECLARE @__endDateLocal_Value_2 datetime2(7) = '2019-03-29';
DECLARE @__p_3 int = 0;
DECLARE @__p_4 int = 50;
SELECT [x.Payer].[Id], [x.Payer].[AssemblyBuyerId], [x.Payer].[CreatedTimeUtc], [x.Payer].[DisplayId], [x.Payer].[EmailAddress], [x.Payer].[FirstName], [x.Payer].[ImportSource], [x.Payer].[ImportSourceReference], [x.Payer].[IsDeleted], [x.Payer].[LastName], [x.Payer].[MobileNumber], [x.Payer].[Postcode], [x.Payer].[StreetAddress], [x.Payer].[SubMerchantId], [x.Payer].[Suburb], [x].[DisplayId] AS [Id0],
(
SELECT TOP(1) [y3].[Status]
FROM [Attempts] AS [y3]
@bjcull
bjcull / white-rabbit-dark-ale-148190.xml
Created August 19, 2019 02:14
White Rabbit Dark Ale - Clone Recipe
<?xml version="1.0" encoding="UTF-8"?>
<RECIPES>
<RECIPE>
<NAME>White Rabbit Dark Ale</NAME>
<STYLE>
<STYLE_GUIDE>BJCP</STYLE_GUIDE>
<VERSION>1</VERSION>
<NAME>Northern English Brown Ale</NAME>
<STYLE_LETTER>C</STYLE_LETTER>
<CATEGORY_NUMBER>11</CATEGORY_NUMBER>
@bjcull
bjcull / mr-leesy.xml
Created August 19, 2019 02:33
Mr Leesy - BeerXML Recipe
<?xml version="1.0" encoding="UTF-8"?>
<RECIPES>
<RECIPE>
<NAME>Mr Leesy</NAME>
<STYLE>
<STYLE_GUIDE>BJCP</STYLE_GUIDE>
<VERSION>1</VERSION>
<NAME>American IPA</NAME>
<STYLE_LETTER>B</STYLE_LETTER>
<CATEGORY_NUMBER>14</CATEGORY_NUMBER>