Skip to content

Instantly share code, notes, and snippets.

View ArthurHNL's full-sized avatar

Arthur Heidt ArthurHNL

  • Brabantine City Row, The Netherlands
  • 17:32 (UTC +02:00)
View GitHub Profile
@ArthurHNL
ArthurHNL / RemoveAllUWPAppsExceptStore.ps1
Last active September 11, 2019 08:52
PowerShell oneliner that removes all UWP apps except the Microsoft Store. I run it after every "fresh" Windows 10 installation.
Get-AppxPackage -AllUsers | Where-Object {$_.name –notlike "*store*"} | Remove-AppxPackage
@ArthurHNL
ArthurHNL / VATVerify.php
Last active August 22, 2019 21:20
EU VIES VAT Verification
<?php
// (c) Arthur Heidt, 2019. Licensed under MIT.
// There is no guarantee that this code works, I have not tested it.
// But it should at least point you in the right direction.
// You must enable the SOAP extension to allow this extension to work.
/**
* Verifies a VAT number using the EU VIES API.
*
* @param string $countryCode The country code for the company of which the VAT number must be
@ArthurHNL
ArthurHNL / VSDevShell.ps1
Created September 23, 2019 07:37
Enter VSDevShell from a stand-alone powershell script
$vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -property installationpath
Import-Module (Join-Path $vsPath "Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation
@ArthurHNL
ArthurHNL / DebuggingSerialize.cs
Created October 28, 2019 11:07
Paste this in the immediate window of VS during a debugging session of a C# project to immideatly serialize an object to JSON. For this to work, Newtonsoft.Json must be present in the current AppDomain.
global::System.IO.File.WriteAllText("temp.json", global::Newtonsoft.Json.JsonConvert.SerializeObject(variableName));
@ArthurHNL
ArthurHNL / EnterVSDevshell.ps1
Created October 28, 2019 13:35
A few lines of powershell code that enters the Visual Studio Developer PowerShell.
$vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -property installationpath
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation