Skip to content

Instantly share code, notes, and snippets.

@rchoffardet
rchoffardet / Container.cs
Last active January 30, 2024 09:47 — forked from karenpayneoregon/Container.cs
Provides code to show start and end index for each element in a list
public class Container<T>
{
public T? Value { get; set; }
public Index StartIndex { get; set; }
public Index EndIndex { get; set; }
}
@rchoffardet
rchoffardet / Program.cs
Last active January 18, 2024 22:40
Thread contention benchmark for exceptions
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using Rchoffardet.Benchmarks.ExceptionPerformance;
var iterationCount = 10_000;
var method = 1;
var totalTimeNs = 0L;
@rchoffardet
rchoffardet / gist:96890edb9c0a10ccfb8ced55b97d4b77
Last active October 30, 2023 22:30
Attack weak md5 signature
using System.Collections.Specialized;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
using System.Web;
var uri = new Uri("http://domain.tld?p1=a&p2=b&p3=c&p4=d&p5=e&p6=f&p7=g&p8=h&p9=i&p10=j");
var parameters = HttpUtility.ParseQueryString(uri.Query);
var toFind = Sign(parameters, "p9", "p2", "p1");
@rchoffardet
rchoffardet / underscore.resolveRelink.js
Created April 23, 2018 11:49 — forked from DrSammyD/underscore.resolveRelink.js
A lodash mixin which will create an object that links and unlinks circular references based on the way json.net handles reference loops. Based on this Stackoverflow answer http://stackoverflow.com/a/21687071/364282

Keybase proof

I hereby claim:

  • I am rchoffardet on github.
  • I am rchoffardet (https://keybase.io/rchoffardet) on keybase.
  • I have a public key whose fingerprint is 56A0 60ED 669D ABB0 7EB3 3AC3 833F C920 F1BA 450B

To claim this, I am signing this object: