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
/// ASP.NET MVC 3 Credit Card Validator Attribute | |
/// by Ben Cull - 4 November 2010 | |
/// | |
/// With special thanks to: | |
/// Thomas @ Orb of Knowledge - http://orb-of-knowledge.blogspot.com/2009/08/extremely-fast-luhn-function-for-c.html | |
/// For the Extremely fast Luhn algorithm implementation | |
/// | |
/// And Paul Ingles - http://www.codeproject.com/KB/validation/creditcardvalidator.aspx | |
/// For a timeless blog post on credit card validation |
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()] | |
param ( | |
[string]$SeqVersion, | |
[string]$SeqPort | |
) | |
$installBasePath = "C:\Install\" | |
$global:seqDataPath = "C:\ProgramData\Seq" | |
function Write-Log |
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 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) |
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 static class ExcelExtensions | |
{ | |
public static FileStreamResult ToDownloadableXmlFileForExcel2003(this System.Xml.Linq.XDocument file, string fileName) | |
{ | |
MemoryStream ms = new MemoryStream(); | |
file.Save(ms); //.Save() adds the <xml /> header tag! | |
ms.Seek(0, SeekOrigin.Begin); | |
var r = new FileStreamResult(ms, "application/vnd.ms-excel"); |
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 class CustomRequireHttpsFilter : RequireHttpsAttribute | |
{ | |
protected override void HandleNonHttpsRequest(AuthorizationContext filterContext) | |
{ | |
// The base only redirects GET, but we added HEAD as well. This avoids exceptions for bots crawling using HEAD. | |
// The other requests will throw an exception to ensure the correct verbs are used. | |
// We fall back to the base method as the mvc exceptions are marked as internal. | |
if (!String.Equals(filterContext.HttpContext.Request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase) | |
&& !String.Equals(filterContext.HttpContext.Request.HttpMethod, "HEAD", StringComparison.OrdinalIgnoreCase)) |
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
<?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> |
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
<?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> |
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 class SubdomainRoute : RouteBase | |
{ | |
public override RouteData GetRouteData(HttpContextBase httpContext) | |
{ | |
if (httpContext.Request == null || httpContext.Request.Url == null) | |
{ | |
return null; | |
} | |
var host = httpContext.Request.Url.Host; |
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
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] |
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 class WordDocumentAttribute : ActionFilterAttribute | |
{ | |
public string DefaultFilename { get; set; } | |
public override void OnActionExecuted(ActionExecutedContext filterContext) | |
{ | |
var result = filterContext.Result as ViewResult; | |
if (result != null) | |
result.MasterName = "~/Views/Shared/_LayoutWord.cshtml"; |
NewerOlder