Skip to content

Instantly share code, notes, and snippets.

View mjebrahimi's full-sized avatar
🎯
Focusing

Mohammad Ebrahimi mjebrahimi

🎯
Focusing
View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active March 16, 2025 16:47
Minimal APIs at a glance
@adams85
adams85 / perftest.cs
Created August 1, 2021 12:19
Benchmark for iterating over random-access collections
using System;
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
namespace MyBenchmarks
{
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
@lmolkova
lmolkova / 0_Tracing_API.md
Last active April 3, 2024 07:08
OpenTelemetry Tracing APIs vs .NET Activity/DiagnosticSource

Tracing API Comparison

A distributed trace is a set of events, triggered as a result of a single logical operation, consolidated across various components of an application. A distributed trace contains events that cross process, network and security boundaries. A distributed trace may be initiated when someone presses a button to start an action on a website - in this example, the trace will represent calls made between the downstream services that handled the chain of requests initiated by this button being pressed.

Contract difference

OpenTelemetry Tracing API is a very strict contract that enables tracing signal (not debugging or profiling). This contract is the same for all kinds of libraries and tracing backends and includes several related concepts:

  • span creation, required and optional properties
  • sampling
  • exporting
  • noop behavior in absence of tracing implementaiton
  • extra information certain types spans should include (e.g. spans for http calls).
@kasuken
kasuken / profiles.json
Created June 23, 2019 12:22
Windows Terminal settings and files
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
@davidfowl
davidfowl / Global.asax.cs
Last active July 8, 2024 22:23
ASP.NET MVC and ServiceCollection sample
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Microsoft.Extensions.DependencyInjection;
using WebApplication16;
using WebApplication16.Controllers;
@hmemcpy
hmemcpy / ramdisk.md
Last active April 6, 2025 02:53
RAMDisk benchmarks
@ststeiger
ststeiger / SevenZipHelper.cs
Created November 18, 2014 10:22
LZMA-Compression with SevenZip SDK
// http://www.nullskull.com/a/768/7zip-lzma-inmemory-compression-with-c.aspx
// http://www.7-zip.org/sdk.html
namespace SevenZip.Compression.LZMA
{
public static class SevenZipHelper
{
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 22, 2025 20:08
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@danielkillyevo
danielkillyevo / ObjectComparer.cs
Last active January 30, 2022 15:57
c# object deep comparison
public class ObjectComparer
{
public static bool Equals(object left, object right)
{
//Compare the references
if (object.ReferenceEquals(right, null))
return false;
if (object.ReferenceEquals(left, right))
return true;