This file contains hidden or 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.Linq; | |
public class Program | |
{ | |
static readonly char[] _trmDelimiters = { ' ', ',', '.', '!', '/' }; | |
static readonly char[] _tagDelimiters = { '[', ']' }; | |
public static void Main() | |
{ |
This file contains hidden or 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(SupportsShouldProcess)] | |
param( | |
[Parameter(Mandatory, Position = 0)] | |
[string] $GroupName | |
) | |
function Test-Module($moduleName) { | |
if (-not (Get-Module $moduleName -ListAvailable)) { | |
Install-Module $moduleName -Scope CurrentUser -Force | |
} |
This file contains hidden or 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
@inject GraphServiceClient GraphClient | |
<AuthorizeView> | |
<Authorized> | |
<img src="@_src" | |
title="@_title" | |
onerror="this.src = '@DEFAULT';" | |
class="rounded-circle img-fluid" | |
@attributes="AdditionalAttributes" /> | |
</Authorized> |
This file contains hidden or 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; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Routing; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using System.Threading.Tasks; | |
var config = new ConfigurationBuilder().AddJsonFile("appsettings.json", optional: false, reloadOnChange: false).Build(); |
This file contains hidden or 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 ( | |
[parameter(parametersetname='test1')] | |
[switch]$p1, | |
[parameter(parametersetname='test2')] | |
[switch]$p2 | |
) | |
DynamicParam |
This file contains hidden or 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
# This function takes a user and a course, but it should be possible to specify either argument | |
# as an ID rather than an instance of the class. | |
# Named parameters work fine, but positional parameters don't always parse correctly. | |
# All the commands at the bottom of this file *should* work. | |
class User { [int] $Id } | |
class Course { [int] $Id } | |
function New-Enrolment { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css" /> | |
</head> | |
<body class="ms-Fabric" dir="ltr"> | |
<p class="ms-fontSize-12" style="line-height: 20px;"><i class="ms-Icon ms-Icon--Calendar" aria-hidden="true"></i> Due 22/03/2020</p> |
This file contains hidden or 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.EntityFrameworkCore; | |
using System; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ |
This file contains hidden or 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
add-type -AssemblyName System.Drawing | |
New-Item "$($env:USERPROFILE)\Pictures\Spotlight" -ItemType directory -Force; | |
New-Item "$($env:USERPROFILE)\Pictures\Spotlight\CopyAssets" -ItemType directory -Force; | |
New-Item "$($env:USERPROFILE)\Pictures\Spotlight\Horizontal" -ItemType directory -Force; | |
New-Item "$($env:USERPROFILE)\Pictures\Spotlight\Vertical" -ItemType directory -Force; | |
foreach($file in (Get-Item "$($env:LOCALAPPDATA)\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*")) | |
{ | |
if ((Get-Item $file).length -lt 100kb) { continue } | |
Copy-Item $file.FullName "$($env:USERPROFILE)\Pictures\Spotlight\CopyAssets\$($file.Name).jpg"; | |
} |
This file contains hidden or 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 System.Linq; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
NewerOlder