Skip to content

Instantly share code, notes, and snippets.

View CodeDux's full-sized avatar
🌳
--. --- / --- ..- - ... .. -.. .

Kristoffer CodeDux

🌳
--. --- / --- ..- - ... .. -.. .
View GitHub Profile
@tkafka
tkafka / Detect electron apps causing macOS Tahoe lag.md
Last active December 29, 2025 19:52
Detect Electron apps on mac where the Electron hasn't yet been updated to fix the system wide lag
@StephenCleary
StephenCleary / ProducerConsumerStream.cs
Created August 24, 2022 21:11
Producer/Consumer Stream
public sealed class ProducerConsumerStream
{
public static Stream Create(Func<Stream, Task> producer, PipeOptions? options = null)
{
var pipe = new Pipe(options ?? PipeOptions.Default);
var readStream = pipe.Reader.AsStream();
var writeStream = pipe.Writer.AsStream();
Run();
return readStream;
@alexyakunin
alexyakunin / EnablePGO.cmd
Created November 17, 2021 05:25
.NET 6 w/ PGO enabled
set DOTNET_ReadyToRun=0
set DOTNET_TieredPGO=1
set DOTNET_TC_QuickJitForLoops=1
@davidfowl
davidfowl / .NET6Migration.md
Last active December 8, 2025 20:34
.NET 6 ASP.NET Core Migration
@davidfowl
davidfowl / MinimalAPIs.md
Last active September 25, 2025 20:44
Minimal APIs at a glance
@DesignFront
DesignFront / detect-dark-mode.js
Last active September 12, 2021 20:04
Detect Darkmode
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// dark mode
}
// to watch for changes:
window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
console.log(`changed to ${e.matches ? "dark" : "light"} mode`)
});
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active December 27, 2025 06:03
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@erdomke
erdomke / Base32.cs
Last active December 27, 2024 20:43 — forked from BravoTango86/Base32.cs
Base32 Encoding and Decoding in C#
/*
* Derived from https://github.com/google/google-authenticator-android/blob/master/AuthenticatorApp/src/main/java/com/google/android/apps/authenticator/Base32String.java
*
* Copyright (C) 2016 BravoTango86
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@maaku
maaku / .gitignore
Last active November 17, 2020 21:53
BIP specifying fast merkle trees, as used in the Merkle branch verification opcodes
*~
install:
- cmd: choco install resharper-clt
after_build:
- cmd: InspectCode.exe -o=resharper-clt-output.xml src\ProjectA.sln
- ps: $result = [xml](Get-Content .\resharper-clt-output.xml)
- ps: $result.Report.Issues.ChildNodes | ForEach-Object {$project = $_.Name; $_.ChildNodes | ForEach-Object {Add-AppveyorCompilationMessage -Message $_.Message -Line $_.Line -FileName $_.File -ProjectName $project}}