Skip to content

Instantly share code, notes, and snippets.

View RickStrahl's full-sized avatar

Rick Strahl RickStrahl

View GitHub Profile
@nick-beer
nick-beer / PushFrameUntilComplete.cs
Created May 30, 2021 10:50
Using PushFrame in a WPF application to prevent UI thread deadlock while synchronously waiting for a task.
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace WpfApp3
{
/// <summary>
@pimatco
pimatco / all-angular-material-components-imports.txt
Last active September 17, 2024 21:54
All Angular Material Components Imports from app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';
@NickCraver
NickCraver / .editorconfig
Created September 26, 2017 21:31
Stack Overflow's .editorconfig
# editorconfig.org
root = true
# Don't use tabs for indentation.
[*]
indent_style = space
[*.less]
charset = utf-8
end_of_line = lf
@davidfowl
davidfowl / websockets.cs
Last active May 15, 2023 05:31
Simple WS ASP.NET Core
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
namespace SimpleWebSockets
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
@incongruousm
incongruousm / PlantUmlEncoder.cs
Last active July 29, 2024 20:16
A C# port of the PlantUml Text Encoding logic as given at http://plantuml.com/pte.html
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Text;
namespace PlantUml.Utils
{
public class PlantUmlTextEncoder
{
public string Encode(TextReader reader)
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active September 11, 2024 20:35
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;