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 / 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>
@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 / 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 / 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)
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 / 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)
@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 / ActiveRouteTagHelper.cs
Last active June 8, 2018 12:14 — forked from anonymous/ActiveRouteTagHelper.cs
Adds an "active" class to the given element when the route parameters match. An Active Route Tag Helper.
[HtmlTargetElement(Attributes = "is-active-route")]
public class ActiveRouteTagHelper : TagHelper
{
private IDictionary<string, string> _routeValues;
/// <summary>The name of the action method.</summary>
/// <remarks>Must be <c>null</c> if <see cref="P:Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper.Route" /> is non-<c>null</c>.</remarks>
[HtmlAttributeName("asp-action")]
public string Action { get; set; }
@bjcull
bjcull / loading-button.js
Created July 8, 2015 13:16
An angular directive for the Ladda loading button. (Requires the jquery ladda plugin).
.directive('loadingButton', [
'$compile', function($compile) {
return {
restrict: 'A',
link: function(scope, element, attr) {
/* attr.style == "data-style" */
if (attr.loadingButtonAnimation && !attr.style) {
element.attr("data-style", attr.loadingButtonAnimation);
} else if (!attr.loadingButtonAnimation && !attr.style) {
element.attr("data-style", "slide-left");
@bjcull
bjcull / ChartDraw.html
Created May 23, 2015 22:11
A prototype graph with user drawn lines over the top
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>