Skip to content

Instantly share code, notes, and snippets.

View MartinJohns's full-sized avatar

Martin Johns MartinJohns

  • Hamburg, Germany
View GitHub Profile
@iamarcel
iamarcel / Creating Neat .NET Core Command Line Apps.md
Last active November 28, 2023 10:41
Creating Neat .NET Core Command Line Apps

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat

anonymous
anonymous / LoginController.cs
Created December 8, 2016 06:31
using AlpacaCore.SiteFramework.SimpleLogin.ViewModels;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http.Authentication;
using SiteFramework.Abstractions;
using SiteFramework.Abstractions.Repositories;
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Collections.Generic;
@ian-p-cooke
ian-p-cooke / add_wsl_exclusions.ps1
Last active June 30, 2024 05:27
powershell script to add WSL exclusions
$win_user = "ipc"
$linux_user = "ipc"
$package = "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc"
$base_path = "C:\Users\" + $win_user + "\AppData\Local\Packages\" + $package + "\LocalState\rootfs"
$dirs = @("\bin", "\sbin", "\usr\bin", "\usr\sbin", "\home\" + $linux_user + "\.cargo\bin")
$dirs | ForEach { Add-MpPreference -ExclusionProcess ($base_path + $_ + "\*") }
Add-MpPreference -ExclusionPath $base_path