Skip to content

Instantly share code, notes, and snippets.

@rstacruz
rstacruz / aider-plan.md
Last active May 20, 2025 05:38
Stop letting Aider code blindly - try this first

Stop letting Aider code blindly - try this first

Using Aider's /ask and /architect commands to approach larger tasks.

Aider is one of the best AI coding tools available today (in my opinion!). It's a brilliant AI coding assistant that integrates with any LLM, in any code editor.

However, Aider can often feel very eager to make changes. It jumps right into coding after I type anything. I noticed a pattern:

  • I would describe what I wanted
  • Aider would start coding right away
@awni
awni / mlx_distributed_deepseek.md
Last active May 22, 2025 02:24
Run DeepSeek R1 or V3 with MLX Distributed

Setup

On every machine in the cluster install openmpi and mlx-lm:

conda install conda-forge::openmpi
pip install -U mlx-lm

Next download the pipeline parallel run script. Download it to the same path on every machine:

@MichaelMoroz
MichaelMoroz / BH.shader
Last active March 25, 2025 16:06
VR Schwarzschild black hole shader (works with SPS and SPS-I)
Shader "Misha/Schwartzschild"
{
Properties
{
[Header(Black Hole)]
_EventHorizonRadius("Event Horizon Radius", Range(0.0, 0.5)) = 0.075
[Header(Accretion)]
[HDR] _AccretionColor("Color", Color) = (1,1,1,1)
@nihalpasham
nihalpasham / CubeCL_Architecture_Overview.md
Last active April 17, 2025 18:53
CubeCL Architecture Overview - Running Rust on your GPU (WebGPU, CUDA)

CubeCL

#gpu #kernel #rust

High Level Overview:

  • GPU kernels in Rust
  • Comptime
    • Automatic vectorization
    • Instruction and shape specialization
  • Loop unrolling
@runevision
runevision / BurstSDFGenerator.cs
Created September 11, 2024 07:48
Signed Distance Field generator for Unity with Burst support
/*
Based on the Anti-aliased Euclidean distance transform described by Stefan Gustavson and
Robin Strand. For further information, see https://contourtextures.wikidot.com/ and
https://web.archive.org/web/20220503051209/https://weber.itn.liu.se/~stegu/edtaa/
The algorithm is an adapted version of Stefan Gustavson's code, it inherits the copyright
statement below, which applies to this file only.
The rewrite with Unity Burst support makes the execution 40 times faster by default,
and 75 times faster if the passed in textures are both of type TextureFormat.RGBAFloat.
#!/usr/bin/env python
"""Get images from PhotoPrism and label them."""
import json
import logging
import tempfile
import time
from pprint import pformat
import boto3
@nurpax
nurpax / test_runner.zig
Last active May 12, 2025 14:27
zig test runner
// Modded from from https://gist.github.com/karlseguin/c6bea5b35e4e8d26af6f81c22cb5d76b
// in your build.zig, you can specify a custom test runner:
// const tests = b.addTest(.{
// .target = target,
// .optimize = optimize,
// .test_runner = .{ .path = b.path("test_runner.zig"), .mode = .simple }, // add this line
// .root_source_file = b.path("src/main.zig"),
// });
@eric-wieser
eric-wieser / GeometricGrades.lean
Created November 21, 2023 13:28
Grade selection with Mathlib
import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction
import Mathlib.LinearAlgebra.ExteriorAlgebra.Grading
set_option pp.proofs.withType false
variable {R M} [CommRing R] [Invertible (2 : R)] [AddCommGroup M] [Module R M] (Q : QuadraticForm R M)
abbrev ExteriorAlgebra.rMultivector (r : ℕ) : Submodule R (ExteriorAlgebra R M) :=
(LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] _) ^ r)
@rao107
rao107 / Ch1-5Q1.lean
Created November 17, 2023 05:47
Chapter 1 Section 5 Q1 of Introduction to Topology by Mendelson
/-
The original problem is incorrect. Instead, we prove that the statement is true
if and only if either A or B is the universe
-/
example (h0 : X ⊆ A) (h1 : Y ⊆ B) :
A = Set.univ ∨ B = Set.univ ↔ (X ×ˢ Y)ᶜ = A ×ˢ Yᶜ ∪ Xᶜ ×ˢ B := by
apply Iff.intro
{
intro h2
rw [Set.compl_prod_eq_union, Set.union_comm]
@fpvandoorn
fpvandoorn / MessyCode.lean
Last active October 9, 2023 17:45
Some experiments using type class graphs in Lean 4
import Mathlib
open Lean Meta Elab Command
-- generalized
/-- Write an import graph, represented as a an array of `NameMap`s to the ".dot" graph format.
If `("style1", graph1)` is in `graphs`, then the edges in `graph1` will be labeled with `[style1]`.
Example: `asStyledDotGraph #[("", graph1), ("style=dashed", graph2)]` -/
def asStyledDotGraph [ForIn Id α Name] (graphs : Array (String × NameMap α))
(header := "import_graph") : String := Id.run do