Skip to content

Instantly share code, notes, and snippets.

View yannduran's full-sized avatar

Yann Duran yannduran

View GitHub Profile
@madskristensen
madskristensen / RemoveBadgeInVS.ps1
Last active June 25, 2021 15:50
Remove Preview badge in VS
function RemoveBadge {
param ($path)
Write-Host "Looking for PreviewBadge.pkgdef in $path"
$file = Get-ChildItem -Path $path -Include *previewbadge.pkgdef -Recurse
if ($file){
Remove-Item $file
Write-Host "PreviewBadge.pkgdef deleted"
@jnm2
jnm2 / JosephPersonalDesktopBoxstarter.ps1
Last active July 28, 2022 11:17
Joseph personal desktop Boxstarter script
# TODO: Set sound scheme to 'No sounds'
# Notepad++ TODOs:
# %appdata%\Notepad++\config.xml, /NotepadPlus/GUIConfigs/GUIConfig[name='TabSetting']/@replaceBySpace, 'yes'
# %appdata%\Notepad++\config.xml, /NotepadPlus/GUIConfigs/GUIConfig[name='auto-completion']/@autoCAction, 0
# %appdata%\Notepad++\stylers.xml, /NotepadPlus/GlobalStyles/WidgetStyle[fontName='Courier New']/@fontName, 'Consolas'
# TODO: unpin Edge and Store and pin default apps
$ErrorActionPreference = 'Stop'
@madskristensen
madskristensen / VSIX-Checklist.md
Last active August 6, 2023 13:07
VS extension checklist

Visual Studio Extensibility Checklist

Here is a list of things to make sure to remember before publishing your Visual Studio extension.

Adhere to threading rules

Add the Microsoft.VisualStudio.SDK.Analyzers NuGet package to your VSIX project, which will help you discover and fix common violations of best practices regarding threading.

Add high-quality icon

All extensions should have an icon associated with it. Make sure the icon is a high-quality .png file with the size 90x90 pixels in 96 DPI or more. After adding the icon to your VSIX project, register it in the .vsixmanifest file as both the Icon and Preview image.

Name and description

/// <summary>
/// Stops keystrokes on a WPF Window or Adornment from propagating to the Visual Studio code editor.
///
/// "The reason that keys like Backspace and Delete do not work in your WPF windows/Adornments is due to Visual Studio's usage of IOleComponentManager and IOleComponent.
/// Visual Studio and WinForms both use IOleComponent as a way of tracking the active component in the application.
///
/// WPF does not implement IOleComponent or use the IOleComponentManager for its windows. This means that when your WPF window is active, Visual Studio doesn't know that its
/// primary component should not be processing command keybindings. Since "Backspace", "Delete", and several other keys are bound to commands for the text editor,
/// Visual Studio continues processing those keystrokes as command bindings."
///
@mkchandler
mkchandler / DisableNuGetPackageRestore.ps1
Last active February 13, 2018 04:07
Disable the NuGet Package Restore functionality in a Visual Studio solution.
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln
# Get the path that the user specified when calling the script
$solution = $args[0]
$solutionPath = Split-Path $solution -Parent
$solutionName = Split-Path $solution -Leaf
# Delete the .nuget directory and all contents
Remove-Item (Join-Path $solutionPath ".nuget") -Force -Recurse -ErrorAction 0
@cr7pt0gr4ph7
cr7pt0gr4ph7 / A.Readme.md
Last active June 25, 2020 20:58
A small demo program in C#, demonstrating the dynamic generation of Xunit tests for each filename in a search path, where the filename matches a pattern. See the included Readme.md file.

A small demo program in C#, demonstrating the dynamic generation of Xunit tests for each filename in a search path, where the filename matches a pattern. This Gist requires xUnit.net to compile.

After reading in the EnumerateFilesFixtureAttribute on the type Tests.AutoPopulatedTest, the main program enumerates all files in the path specified by the attribute that also match the searchPattern (e.g. "*.json").

It then uses System.Reflection.Emit to emit a test method for each of the files found. Each generated test method is also decorated with a [Xunit.FactAttribute] to make the Xunit test runner recognize it.

By modifying the value of the generated DisplayName property, one can change how the generated tests are displayed in the Xunit GUI runner, for example.

anonymous
anonymous / gist:138571
Created July 1, 2009 03:37
<Style TargetType="TabsStudio:Tab" BasedOn="{StaticResource DefaultTabStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabsStudio:Tab}">
<Grid>
<Border Name="Border" BorderBrush="#609ABA" BorderThickness="1,1,1,0" CornerRadius="3,3,0,0">
<ContentPresenter ContentSource="Header" Margin="12,2,12,2"/>
</Border>
</Grid>
<ControlTemplate.Triggers>