Skip to content

Instantly share code, notes, and snippets.

@jboner
jboner / latency.txt
Last active April 23, 2025 18:02
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@banaslee
banaslee / XGH - de-de.txt
Last active April 14, 2025 05:43
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Quelle: http://gohorseprocess.wordpress.com
Übersetzung ursprünglich von https://gist.github.com/Neffez/f8d907ba8289f14e23f3855011fa4e2f
1. Ich denke, also ist es nicht XGH.
In XGH wird nicht gedacht, es wird das erste gemacht, was in den Sinn kommt. Es gibt auch keine zweite Option, die erste ist schneller.
2. Es gibt 3 Wege ein Problem zu lösen: den richtigen Weg, den falschen Weg und den XGH Weg, welcher exakt wie der falsche ist, aber schneller.
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active January 1, 2025 13:18
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

Font Stack

Font Device Targeted
-apple-system (San Francisco) iOS Safari, macOS Safari, macOS Firefox
BlinkMacSystemFont (San Francisco) macOS Chrome
Segoe UI Windows
Roboto Android, Chrome OS
Oxygen / Oxygen-Sans KDE
Fira Sans Firefox OS
@xt0rted
xt0rted / SentryTagHelper.cs
Created August 30, 2018 07:58
ASP.NET Core tag helper for Sentry
namespace Website.TagHelpers
{
using System.Security.Claims;
using System.Text;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Options;
public class CountTruesBenchmarks
{
private readonly bool[] boolArray;
public CountTruesBenchmarks()
{
var rnd = new Random(42);
boolArray = Enumerable.Range(0, 500).Select(_ => rnd.NextBoolean()).ToArray();
}
@bjorkstromm
bjorkstromm / program.cs
Created July 17, 2019 22:10
Catalog ids from Registration
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace ConsoleApp3
git config --global alias.lgb "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches"
import io.sentry.core.Sentry
import io.sentry.core.SentryEvent
import leakcanary.DefaultOnHeapAnalyzedListener
import leakcanary.OnHeapAnalyzedListener
import shark.HeapAnalysis
import shark.HeapAnalysisFailure
import shark.HeapAnalysisSuccess
import shark.Leak
import shark.LeakTrace
import shark.LibraryLeak