Skip to content

Instantly share code, notes, and snippets.

@xoofx
xoofx / BenchDelegatesApp.cs
Created February 19, 2019 19:56
Benchmarks of calli vs delegate
// | Method | Mean | Error | StdDev |
// |------------- |----------:|----------:|----------:|
// | Calli | 0.6718 ns | 0.0013 ns | 0.0012 ns |
// | Delegate | 1.1366 ns | 0.0099 ns | 0.0088 ns |
// | FastDelegate | 1.6239 ns | 0.0103 ns | 0.0097 ns |
// MyClassLib.cs is compiled in another project (havent tested if compiling with Fody is working with BenchmarkDotnet in the same project)
// This file is referencing BenchDelegates.MyClassLib
using System;
@tkellogg
tkellogg / gist:5619461
Created May 21, 2013 12:33
How I installed mono 3 and monodevelop 4 on Ubuntu 13.04 with NuGet and F# support
# Add this line to your software sources
deb http://debian.meebey.net/experimental/mono /
sudo apt-get update
# of course, apt-get remove mono-complete first...
sudo apt-get install mono-complete
# I installed monodevelop from apt just to get all the prereqs
sudo apt-get install monodevelop
@jbtule
jbtule / AESGCM.cs
Last active October 30, 2023 21:14
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;