Skip to content

Instantly share code, notes, and snippets.

💲
Helping people get paid

Ben Cull bjcull

💲
Helping people get paid
Block or report user

Report or block bjcull

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bjcull
bjcull / mr-leesy.xml
Created Aug 19, 2019
Mr Leesy - BeerXML Recipe
View mr-leesy.xml
<?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 Aug 19, 2019
White Rabbit Dark Ale - Clone Recipe
View white-rabbit-dark-ale-148190.xml
<?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 Mar 29, 2019
SQL Output for my perhaps not so efficient query
View paymentsInProcess.qry
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
Adds all custom claims to the asp.net core identity
View AddAllClaimAction.cs
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)
View AsExpandableExtension.cs
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 Nov 27, 2017
The current time service I use to keep track of dates relative to a certain timezone.
View TimeService.cs
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 Oct 26, 2017 — 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/
View Install-Seq.ps1
[CmdletBinding()]
param (
[string]$SeqVersion,
[string]$SeqPort
)
$installBasePath = "C:\Install\"
$global:seqDataPath = "C:\ProgramData\Seq"
function Write-Log
@bjcull
bjcull / ActiveRouteTagHelper.cs
Last active Jun 8, 2018 — forked from anonymous/ActiveRouteTagHelper.cs
Adds an "active" class to the given element when the route parameters match. An Active Route Tag Helper.
View ActiveRouteTagHelper.cs
[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 Jul 8, 2015
An angular directive for the Ladda loading button. (Requires the jquery ladda plugin).
View loading-button.js
.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
A prototype graph with user drawn lines over the top
View ChartDraw.html
<!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>
You can’t perform that action at this time.