Skip to content

Instantly share code, notes, and snippets.

View DanielLarsenNZ's full-sized avatar

Daniel Larsen DanielLarsenNZ

View GitHub Profile
@DanielLarsenNZ
DanielLarsenNZ / reclaim-windows-11.ps1
Last active March 19, 2024 10:47
reclaim-windows-11.ps1
##########
# Tweaked Win11 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Modified by: @DanielLarsenNZ - based on my personal preferences. Some additions for Windows 11
# Version: 2.12.2, 2021-12-11
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
@DanielLarsenNZ
DanielLarsenNZ / reclaimWindows10.ps1
Last active April 16, 2019 03:35 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults)
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Modified by: @DanielLarsenNZ - based on my personal preferences.
# Version: 2.12.2, 2019-04-16
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
@DanielLarsenNZ
DanielLarsenNZ / HelloAsync\Program.cs
Last active October 12, 2016 21:10
Task.Result property Waits and blocks
using System;
using System.Threading.Tasks;
namespace HelloAsync
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Main: line 10");
@DanielLarsenNZ
DanielLarsenNZ / AssignOAuth2SecurityRequirements.cs
Last active August 18, 2016 22:33
AssignOAuth2SecurityRequirements class for Swagger UI Auth
/*
The MIT License (MIT)
Copyright (c) 2016 Daniel Larsen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@DanielLarsenNZ
DanielLarsenNZ / SwaggerConfig.cs
Last active December 9, 2022 06:38
SwaggerConfig.cs for OAuth2 in ASP.NET Web API to enable Swagger UI auth with Azure AD
/*
The MIT License (MIT)
Copyright (c) 2016 Daniel Larsen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@DanielLarsenNZ
DanielLarsenNZ / loadtestresultsrepository-localdb.sql
Last active June 1, 2023 04:50
Visual Studio Load Test results repository creation script for LocalDB
-- Creates the Visual Studio Load Test Results Repository in LocalDB, so that you don't have to install SQL Server.
-- Adapted from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\loadtestresultsrepository.sql
-- See also: https://msdn.microsoft.com/en-us/library/ms182600(v=vs.120).aspx
-- Usage example: from the Visual Studio Developer Command Prompt (note SQLCMD switches are case sensitive):
-- SQLCMD /S (LocalDB)\v11.0 /i loadtestresultsrepository-localdb.sql
IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'LoadTest2010')
BEGIN
CREATE DATABASE [LoadTest2010] COLLATE SQL_Latin1_General_CP1_CI_AS
public interface ILogger {
void WriteError(Exception ex);
void WriteError(Excpetion ex, string message, params args[]);
void WriteWarning(string message, params args[]);
void WriteInfo(string message, params args[]);
}