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
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; | |
} |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using FluentAssertions; | |
using Xunit; | |
namespace Advent3 | |
{ |
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
module Tests | |
open System | |
open Xunit | |
open System.IO | |
let readLines (filePath:string) = seq { | |
use sr = new StreamReader (filePath) | |
while not sr.EndOfStream do |
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
# 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 |
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
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. |
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
namespace Extensions | |
{ | |
using System; | |
using System.IO; | |
using System.Reflection; | |
public static class AssemblyExtensions | |
{ | |
public static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = 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
$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 |
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
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 |
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
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; |
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
[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"))); |
NewerOlder