Skip to content

Instantly share code, notes, and snippets.

View reejk's full-sized avatar

Roman reejk

View GitHub Profile
@reejk
reejk / CursorCausesGCCollect.cs
Created April 9, 2020 20:50
WPF Bug: Cursors.None causes GC.Collect
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
namespace WpfCore
{
@reejk
reejk / LzwEncoder.cs
Last active July 3, 2018 09:07
LzwEncoder using ByteArrayEqualityComparer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace SimpleGif.GifCore
{
internal sealed class ByteArrayEqualityComparer : IEqualityComparer<byte[]>
{
public bool Equals(byte[] x, byte[] y)
@reejk
reejk / CodeGeneration.cs
Created June 8, 2018 10:25
CodeGeneration Benchmark
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
namespace Benchmark
{
@reejk
reejk / MainWindow.xaml
Last active April 12, 2018 21:14
AvaloniaUI: Resource in DataTemplate not found
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AvaloniaBugTest;assembly=AvaloniaBugTest"
Title="AvaloniaBugTest" Width="500" Height="500">
<Window.Resources>
<local:SharedBrush x:Key="ResBackground" Value="White" />
<local:SharedBrush x:Key="ResForeground" Value="Blue" />
</Window.Resources>
<DockPanel>
<ListBox Width="200">