Skip to content

Instantly share code, notes, and snippets.

View luidgigromat's full-sized avatar

Luidgi Gromat luidgigromat

  • Ypso-Facto
  • France
View GitHub Profile
@brenopolanski
brenopolanski / export-svg-inkscape.md
Created December 26, 2017 13:29
Exporting an object as svg from inkscape
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
@LGM-AdrianHum
LGM-AdrianHum / ListBoxStyle.xaml
Created October 11, 2017 23:56
Changing WPF Listbox SelectedItem text color and highlight/background Color
<Window x:Class="ListBoxStyle.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:ListBoxStyle"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style x:Key="_ListBoxItemStyle" TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
@jonlabelle
jonlabelle / async_await_best_practices_cheatsheet.md
Last active May 12, 2024 03:58
C# Asynchronous Programming Guideline Cheat Sheet

Async Await Best Practices Cheat Sheet

Summary of Asynchronous Programming Guidelines

Name Description Exceptions
Avoid async void Prefer async Task methods over async void methods Event handlers
Async all the way Don't mix blocking and async code Console main method
Configure context Use ConfigureAwait(false) when you can Methods that require con­text
@RichardD2
RichardD2 / AnonymousComparer.cs
Created June 17, 2015 20:17
Build an IComparer<T> for multiple properties, based on a mapping to an anonymous type.
public static class AnonymousComparer
{
private static class DefaultComparerCache
{
private static readonly ConcurrentDictionary<Type, Expression> Cache = new ConcurrentDictionary<Type, Expression>();
private static Expression GetDefaultComparerCore(Type propertyType)
{
var genericTypeDefinition = typeof(Comparer<>);
var comparerType = genericTypeDefinition.MakeGenericType(propertyType);
@dkalamari
dkalamari / gist:10975989
Created April 17, 2014 11:32
WPF Event to Command
NuGet installation
PM> Install-Package System.Windows.Interactivity.WPF
Must be installed in Main project also!!!
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding SetUserCommand}"/>
</i:EventTrigger>
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: