Skip to content

Instantly share code, notes, and snippets.

@bagbag
bagbag / optimization.md
Created May 12, 2025 21:53
Rust compiler optimization
  1. Dead Code Elimination (DCE) Isn't Perfect (or happens late):

    • Ideal Scenario: You'd expect the compiler's DCE pass to recognize that the Deserialize implementations generated by the derive macro are never called and completely eliminate them from the final binary anyway. If DCE worked perfectly and early, removing the derive manually shouldn't change the size much, as the code was already being discarded.
    • Reality: The analysis for DCE, especially across crates and with complex features like generics and macros (which serde uses heavily), can be intricate. Sometimes, code might appear reachable during earlier compilation stages or might have subtle linkages that prevent easy removal until LTO.
  2. The Butterfly Effect of Optimization Heuristics:

    • Compilers use complex heuristics to decide how to optimize code: when to inline functions, how to allocate registers, how to arrange code blocks for cache efficiency, etc.
  • Removing the #[derive(Deserialize)] cha
@skorasaurus
skorasaurus / localconfig.json
Last active November 20, 2026 04:27
[
{
"where": "Layer",
"if": {
"Datasource.type": "postgis"
},
"then": {
"Datasource.dbname": "hdmht",
"Datasource.user": "skors",
"Datasource.host": "localhost"
@Sh-ui
Sh-ui / the-alchemist.md
Last active November 20, 2026 04:25
The Alchemist by Paul Coello. Translated by Alan R. Clarke. Published 1992. ISBN 0-7225-3293-8.
@JustAChucklin
JustAChucklin / modding_rdr2_on_linux.md
Created July 19, 2025 17:25
Modding RDR2 on Linux-Based Systems

How-to on Modding RDR2

Files

ScriptHook

  • Step 1 is you're going to need dinput8.dll for RDR2 move the dinput8.dll file from this archive located in /bin/ into the root RDR2 folder
  • Now download the ScriptHookV2 move the ScriptHookRDR2.dll into your main RDR2 folder (where the rdr2.exe file is located)

Congrats ScriptHook is now installed, we will finish the setup for this later.

@seraphicfae
seraphicfae / screwdiscord.md
Last active November 20, 2026 04:04
How to make Discord not display Quest tab on startup

Sooo, what's going on..?

Discord has decided to make the default page when you open the app to be the Quest home page, and we're not going to let them. Only a few users are experiencing this, so you may not be affected. (yet)

Linux and other *nix:

desktop-file-edit --set-key Exec --set-value "/usr/bin/discord discord://-/channels/@me" /usr/share/applications/discord.desktop

Flatpak:

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@McFunkypants
McFunkypants / gist:87f07ac5e8affad34391
Last active November 20, 2026 03:53
Sid Meier's 10 Rules of Game Design
Sid Meier's 10 Rules of Game Design
1. Choose a topic you have a passion for. Game Design is about creativity.
2. Do research after the game is done. Tap into the player’s brain.
3. Define your axioms, refine your axioms. Prototype, prototype, prototype; sit in all the chairs.
4. Double it or cut it in half. You are more wrong than you think.
@hueyexe
hueyexe / intune-fedora-44-guide.md
Last active November 20, 2026 03:46
Microsoft Intune + Firefox Entra SSO on Fedora 44 (unsupported but working, 2026)

Microsoft Intune + Entra SSO on Fedora 44 (2026)

Date: 2026-09-21 Tested on: Lenovo ThinkPad, Fedora 44 Workstation, x86_64, GNOME 50/Wayland Result: Enrolled and reporting compliant. Conditional-Access-gated apps work in Edge and Firefox.

Warning

Fedora is not a supported Intune platform. Microsoft supports only Ubuntu 24.04/26.04 LTS and RHEL 9/10. This worked, but nothing here is supported by Microsoft, and an OS or Intune update can break it.