Skip to content

Instantly share code, notes, and snippets.

@gluck
gluck / FromEventBenchmark.cs
Last active October 15, 2021 09:03
Benchmark showing performance increase using FromEvent with conversion over FromEventPattern, using BenchmarkDotNet library
[BenchmarkTask(platform: BenchmarkPlatform.X86, jitVersion: BenchmarkJitVersion.LegacyJit)]
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.LegacyJit)]
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.RyuJit)]
public class FromEventBenchmark
{
readonly Control control = new Control();
[Benchmark]
public void FromEventPattern()
{
Observable.FromEventPattern<EventHandler, EventArgs>(h => control.SizeChanged += h, h => control.SizeChanged -= h).Select(p => p.EventArgs)
@StephenCleary
StephenCleary / ObservableProgress.cs
Last active April 16, 2024 11:22
ObservableProgress
using System;
using System.Reactive.Linq;
using System.Threading;
/// <summary>
/// Helper methods for using observable <see cref="IProgress{T}"/> implementations. These are hot observables.
/// </summary>
public static class ObservableProgress
{
/// <summary>
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@agungf
agungf / gist:8803512
Created February 4, 2014 13:25
Remove passphrase (password) from private RSA key
Should also work for:
[v] any OpenSSH installation
Given, your key is in id_rsa
1
Passphrase is needed?
Try some host which has your public key (id_rsa.pub)
@denji
denji / http-benchmark.md
Last active May 2, 2024 06:26
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@rxaviers
rxaviers / gist:7360908
Last active May 6, 2024 17:53
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@robfe
robfe / Hubs.tt
Last active March 18, 2020 16:17
T4 template that creates Typescript type definitions for all your Signalr hubs. If you have C# interface named "I<hubName>Client", a TS interface will be generated for the hub's client too.If you turn on XML documentation in your build, XMLDoc comments will be picked up.Licensed with http://www.apache.org/licenses/LICENSE-2.0
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".d.ts" #>
<# /* Update this line to match your version of SignalR */ #>
<#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.2.2.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll" #>
<# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #>
<#@ assembly name="$(TargetPath)" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Web" #>
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>