Skip to content

Instantly share code, notes, and snippets.


Vladimir Kozlov aienabled

View GitHub Profile
a4099181 / Convert-ToPackageReference.ps1
Last active Feb 18, 2021
Converts packages.config into PackageReference at *.csproj project file. Requires XSLT stylesheet available as second file in the gist.
View Convert-ToPackageReference.ps1
Function Convert-ToPackageReference
Param ( [Parameter( Mandatory, ValueFromPipeline )][String] $inputUri,
[String] $stylesheetUri = "",
[String] $resultsFile = [System.IO.Path]::GetTempFileName() )
Process {
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load( $stylesheetUri )
$xslt.Transform( $inputUri, $resultsFile )
Jargon64 / RSACryptoServiceProviderExtensions.cs
Last active Jun 17, 2021
RSACryptoServiceProvider Extension to add FromXmlString and ToXmlString methods for ASP.NET Core
View RSACryptoServiceProviderExtensions.cs
using System;
using System.Security.Cryptography;
using System.Xml;
namespace RSACryptoServiceProviderExtensions
public static class RSACryptoServiceProviderExtensions
public static void FromXmlString(this RSACryptoServiceProvider rsa, string xmlString)
hperantunes / tail-grep.ps1
Created Feb 25, 2016
tail + grep powershell equivalent
View tail-grep.ps1
Get-Content C:\temp\mylogfile.log -tail 100 –wait | Select-String 'search'
StevenLiekens / TypeMemberLayout.xaml
Last active May 15, 2021
StyleCop Type Member Layout for Resharper 9
View TypeMemberLayout.xaml
<?xml version="1.0" encoding="utf-16"?>
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="COM interfaces" Priority="2000">
<Kind Is="Interface" />
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
jen20 / CharacterEllipsisButtonStyle.xaml
Created Jan 6, 2014
WPF style which puts character ellipsis on button contents without replacing the ContentPresenter with a TextBlock and thus losing the ability to support access keys.
View CharacterEllipsisButtonStyle.xaml
<Style x:Key="CharacterEllipsisTextButtonStyle" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle">
<Setter Property="Control.Template">
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
nickgravelyn / TextureManager.cs
Last active Jul 17, 2018
A texture manager for XNA that allows for "hot reloading" of textures in debug mode by using Texture2D.FromStream to load PNG files with the same name as the content requested. Falls back to content loading in release mode or if there's no PNG available. SpriteTexture has some extra stuff for tiles since I need it in my game, but the important t…
View TextureManager.cs
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
namespace MyGame
public class SpriteTexture