Skip to content

Instantly share code, notes, and snippets.

View lennybacon's full-sized avatar
🏠
Working from home

Daniel Fisher lennybacon

🏠
Working from home
View GitHub Profile
@lennybacon
lennybacon / Add-VisualStudio2017Components.ps1
Last active March 28, 2018 12:58
Add components to visual studio 2017 community installation
Start-Process `
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" `
-Wait `
-ArgumentList @( `
"modify",
"--installPath `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community`"",
"--add Microsoft.VisualStudio.Component.VC.CoreIde",
"--add Microsoft.VisualStudio.Component.Windows10SDK",
"--add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop",
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
@lennybacon
lennybacon / ServerTiming.js
Created February 17, 2018 15:41
An JavaScript illustrating the usage of the W3C Server Timing API
if(!window.performance){
document.writeln('<div class="alert alert-danger">Your browser does NOT the Performance API</div>');
} else {
loopServerTiming: for (const entryType of ['navigation', 'resource']) {
for (const {name: url, serverTiming} of performance.getEntriesByType(entryType)) {
if(!serverTiming){
document.writeln('<div class="alert alert-danger">Your browser does NOT the Server Timing API</div>');
break loopServerTiming;
}
for (const {name, duration, description} of serverTiming) {
@lennybacon
lennybacon / ServerTiming.ashx
Created February 17, 2018 15:40
An ASP.NET Handler illustrating the usage of the W3C Server Timing HTTP Header
<%@ WebHandler Language="C#" Class="Samples.MyHandler" %>
using System;
using System.Web;
namespace Samples
{
/// <summary>
///TODO:DESCRIPTION HERE
/// </summary>
public class MyHandler
: IHttpHandler
@lennybacon
lennybacon / RemoveFiddlerCertificates.ps1
Last active April 26, 2020 21:17
Remove Fiddler Certificates
Get-ChildItem Cert:\CurrentUser\My
| Where-Object {$_.Issuer -eq 'CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com'}
| Remove-Item;
# Requires user interaction
#Get-ChildItem Cert:\CurrentUser\Root
#| Where-Object {$_.Issuer -eq 'CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com'}
#| Remove-Item;
# Requires user interaction
@lennybacon
lennybacon / RemoveFiddlerCertificatesOnStartUpTask.xml
Last active April 26, 2020 21:16
Remove Fiddler Certificates on Start Up Task
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2018-02-17T10:29:54.0880708</Date>
<Author>.\Administrator</Author>
<URI>\CleanUp\Remove Fiddler Certificates on StartUp</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
@lennybacon
lennybacon / source.extension.vsixmanifest.xml
Created February 9, 2018 15:49
Icons assets for vsixmanifest
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
...
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="File" Path="icons.pkgdef" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
...
</PackageManifest>
@lennybacon
lennybacon / icons.pkdef
Created February 9, 2018 15:45
Icon package definition
[$RootKey$\ShellFileAssociations\.{EXTENSION_HERE}]
"DefaultIconMoniker"="{GUID_HERE}:{NUMBER_HERE}"
@lennybacon
lennybacon / Monikers.imagemanifest.xml
Last active February 9, 2018 15:46
Icon Moniker manifest
<?xml version="1.0" encoding="utf-8"?>
<ImageManifest
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/VisualStudio/ImageManifestSchema/2014">
<Symbols>
<String Name="Resources" Value="/{ASSEMBLYNAME_HERE};Component/Icons" />
<Guid Name="MonikersGuid" Value="{GUID_HERE}" />
<ID Name="{EXTENSION_HERE}" Value="{NUMBER_HERE}" />
</Symbols>
@lennybacon
lennybacon / swallow-gitOutputToStdErrForTfsBuild.ps1
Created February 5, 2018 15:22
Swallow GIT output to STDERR when running in PowerShell from Team Foundation Build vNext
& git config user.email "donotreply@example.org"
& git config user.name "Build Server"
$o = Invoke-Expression "& git fetch origin master 2>&1"
$o = Invoke-Expression "& git checkout master 2>&1"
@lennybacon
lennybacon / exclude-step-from-scheduled-build.tfs
Created January 2, 2018 10:24
Exclude step from scheduled build in TFS
and(succeeded(), ne(variables['Build.RequestedFor'], 'Microsoft.TeamFoundation.System'))