Skip to content

Instantly share code, notes, and snippets.

View aeged's full-sized avatar

Alexander Gednov aeged

View GitHub Profile
@aeged
aeged / wider-text.css
Created January 21, 2026 20:11
how to make the obsidian editor and reading views line width look better (more like Medium/Substack width). Put this inside `vault/.obsidian/snippets/`
/* 1. Define your preferred width in ONE place so they match perfectly */
body {
--custom-width: 850px; /* Adjust this value to change width for BOTH views */
}
/* 2. Fix Reading View */
.markdown-preview-view.is-readable-line-width .markdown-preview-sizer {
max-width: var(--custom-width) !important;
}

(generated by Gemini 3 Pro, apparently inspired by StreakyCobra's viral HN post)

How to version control dotfiles

  1. Create the Bare Repo for Dotfiles We create a hidden folder (e.g., .cfg or .dotfiles) to hold the database.
git init --bare $HOME/.cfg

How to create an parallelizable agentic git worktree setup

Built for agentic setups (guide generated by Gemini 3 Pro)

Step 1: "Prime" the Repository

We create a temporary folder solely to generate the initial commit.

# 1. Create your project root
@aeged
aeged / binary_classifier_from_scratch_in_numpy.ipynb
Created January 3, 2026 02:28
binary_classifier_from_scratch_in_numpy.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aeged
aeged / mostly_uniform_cover_perms.py
Last active August 29, 2025 07:29
(Mostly) Uniform Subset Covering – A vectorized implementation of a sampling algorithm where we want to generate multiple permuted subsets each of size k with some minimum element replication factor r, with some elements being seen more than r times. It really all depends on the random number generation and only happens if n%k!=0
import gc
import statistics
import time
import typer
import numpy as np
from pprint import pprint
from typing import Annotated, Counter
def mostly_uniform_cover_perms(n: int, k: int, r: int):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aeged
aeged / binary_min_heap.py
Created June 25, 2025 04:13
a naive binary min-heap implementation with an array backend. bubble up value swapping for insertions, and bubble down swapping for deletions
"""implementation of a heap"""
from typing import TypeVar, Generic, List, Optional
T = TypeVar('T') # declare a type variable
class MinHeap(Generic[T]):
"""all elements must satisfy
for a parent element, it must be less than both it's children
"""
def __init__(self) -> None:
@aeged
aeged / macos_setup_inst.md
Last active May 20, 2022 20:18
setting up mac for development

mac dev setup

# install xcode cli tools as a core dependency
xcode-select --install

# install homebrew because it's awesome
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# set up basic zshrc 
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aeged
aeged / copy.cpp
Last active February 2, 2020 21:34
A quick main() reference program for a C++ command line program that takes an input and output file as args.
/** copy.cpp - a simple C++ program to copy a file **/
#include <iostream>
#include <fstream>
void copyFile(std::ifstream& ifile, std::ofstream& ofile);
int main (int argc, char* argv[]) {
/* check for correct number of arguments*/
if (3 != argc) {