Skip to content

Instantly share code, notes, and snippets.

View MrKevHunter's full-sized avatar

Kev Hunter MrKevHunter

  • www.empactis.com
  • Berkshire
View GitHub Profile
static async Task Main(string[] args)
{
var dateTime = System.DateTime.MinValue;
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (HttpRequestMessage arg1, X509Certificate2 arg2, X509Chain arg3, SslPolicyErrors arg4) =>
{
dateTime = arg2.NotAfter;
return true;
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using FluentAssertions;
using Xunit;
namespace Advent3
{
module Tests
open System
open Xunit
open System.IO
let readLines (filePath:string) = seq {
use sr = new StreamReader (filePath)
while not sr.EndOfStream do
@MrKevHunter
MrKevHunter / Get-AzureADAppsInfo.ps1
Created February 15, 2018 09:53 — forked from svarukala/Get-AzureADAppsInfo.ps1
Outputs list of all Azure AD Apps along with their expiration date, display name, owner email, credentials (passwordcredentials or keycredentials), start date, key id and usage. Useful to know the apps that are expiring and take action (renew).
# Requires Azure AD PowerShell Module
#Prompts user to login using Azure Credentials
#Connect-AzureAD
$results = @()
Get-AzureADApplication -All $true | %{
$app = $_
$owner = Get-AzureADApplicationOwner -ObjectId $_.ObjectID -Top 1
function Get-NetworkStatistics {
<#
.SYNOPSIS
Display current TCP/IP connections for local or remote system
.FUNCTIONALITY
Computers
.DESCRIPTION
Display current TCP/IP connections for local or remote system. Includes the process ID (PID) and process name for each connection.
@MrKevHunter
MrKevHunter / AssemblyExtensions.cs
Last active December 19, 2017 10:13
Application Build Date and Version Serilog Enricher
namespace Extensions
{
using System;
using System.IO;
using System.Reflection;
public static class AssemblyExtensions
{
public static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null)
$li = gc C:\temp\input.txt
$t = 0
foreach($l in $li){
$m = $l.Split("`t") | Measure-Object -Max -Min
$t+=$m.Maximum - $m.Minimum
}
$t
Items in your basket
Item Name & Stock Status Qty Remove Price Subtotal
Intel Core i7 7700K 4.2GHz Quad Core (Socket 1151)
In Stock for Next Day DeliveryOrder for Pickup in 1-2 Days
CCL Code: CPU0431
1
namespace EfSerilogTest
{
using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.Entity.Validation;
using Serilog;
using Serilog.Exceptions;
[Fact]
public void WhenGivenTwoOrsWithAnAndWithANot()
{
var queryable =
context.Query<WebUser>()
.Query(
X =>
(X.Forename.Contains("Louis") || X.Forename.Contains("Wanda")) &&
!(X.Surname.Contains("Fox") || X.Surname.Contains("Castillo")));