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 N2Extensions | |
{ | |
public static string FullUrl(this N2.ContentItem item) | |
{ | |
return HttpContext.Current.Request.Url.GetBaseUri().OriginalString + item.Url; | |
} | |
} |
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
using System.Linq; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Razor.TagHelpers; | |
namespace Infrastructure.MVC | |
{ | |
[HtmlTargetElement(Attributes = "required-claim")] | |
public class RequiredClaimsTagHelper : TagHelper | |
{ | |
private readonly IHttpContextAccessor httpContextAccessor; |
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
using System.Linq; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Razor.TagHelpers; | |
using Microsoft.AspNetCore.Mvc.Infrastructure; | |
using Microsoft.AspNetCore.Mvc.Abstractions; | |
using Microsoft.AspNetCore.Mvc.Controllers; | |
using Microsoft.AspNetCore.Mvc.Authorization; | |
using Microsoft.AspNetCore.Authorization; | |
using System.Threading.Tasks; |
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
using System.Linq; | |
using System.Security.Claims; | |
using System.Security.Principal; | |
namespace Infrastructure.Claims | |
{ | |
public static class ClaimExtensions | |
{ | |
public static void AddUpdateClaim(this IPrincipal currentPrincipal, string key, string value) |
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
using System.Collections.Generic; | |
using System.Linq; | |
public static class IEnumerableExtensions | |
{ | |
public static bool IsEmpty<T>(this IEnumerable<T> enumerable) | |
{ | |
if (enumerable == null) return true; | |
// If this is a list, use the Count property for efficiency. |
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
using Microsoft.AspNetCore.Http; | |
using Newtonsoft.Json; | |
using System; | |
using System.Linq; | |
using System.Net; | |
using System.Threading.Tasks; | |
namespace Infrastructure.Middleware | |
{ | |
public class MediatrErrorHandlingMiddleware |
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
using System; | |
using System.Collections.Generic; | |
using Raven.Client.Documents.Session.Loaders; | |
namespace LesserKnownFeatures | |
{ | |
public class Company | |
{ | |
public string Id { get; set; } | |
public string ExternalId { get; set; } |
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
using System; | |
using Microsoft.ML; | |
using Microsoft.ML.Data; | |
public class SentimentIssue | |
{ | |
[LoadColumn(0)] | |
public bool Label { get; set; } | |
[LoadColumn(2)] |
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
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using DocumentFormat.OpenXml.Packaging; | |
using DocumentFormat.OpenXml.Spreadsheet; | |
using DocumentFormat.OpenXml.Wordprocessing; | |
public static class Office | |
{ | |
public static IEnumerable<string> GetExcelText(Stream stream) |
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
:: Install choco .exe and add choco to PATH | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" | |
:: Install all the packages | |
:: choose: visual studio, office, .net core, .net, rider tools | |
:::: Dev tools | |
choco install git.install -y | |
choco install gitkraken | |
choco install vscode -y |
OlderNewer