Skip to content

Instantly share code, notes, and snippets.

View tlkahn's full-sized avatar
🥫

JG tlkahn

🥫
View GitHub Profile
@tlkahn
tlkahn / fast_conway_mlx.py
Created August 31, 2024 02:12 — forked from awni/fast_conway_mlx.py
Conway's Game of Life Accelerated with Custom Kernels in MLX
import av
import numpy as np
import mlx.core as mx
def conway(a: mx.array):
source = """
uint i = thread_position_in_grid.x;
uint j = thread_position_in_grid.y;
uint n = threads_per_grid.x;
@tlkahn
tlkahn / main.py
Created August 26, 2024 03:28
my gcm
import git
def summarize_diffs(path: str, suffix: str) -> str:
repo = git.Repo(path)
index = repo.index
result = ""
# Get the staged changes as a text diff
staged_diff = index.diff(
"HEAD",
@tlkahn
tlkahn / gist:73e62ba0e5727bccf4cff770da8c4fb0
Created July 20, 2024 01:16
some mindmapping software alternatives
https://github.com/juzzlin/Heimer
https://github.com/dvorka/mindforger
@tlkahn
tlkahn / koan.ts
Created July 18, 2024 06:07
typescript koan
// Literal type
type Drinks = 'Coke' | 'Milk' | 'Water' | 'Coffee';
type UnUnite<T, K> = T extends K ? never : T;
type Result = UnUnite<string | number | boolean, string>; // Result: number | boolean
type HealthDrinks = UnUnite<Drinks, 'Coke'>;
// `infer`
// "destructuring type". "Pattern matching"
//github.com/jasmit-vaghasiya/Microservice-Architecture-and-System-Design-with-Python-Kubernetes
//github.com/uzochukwueddie/jobberapp
//github.com/srijan-paul/tsfun/
@tlkahn
tlkahn / koan.ts
Created July 14, 2024 03:46
a koan collection for typescript
// Literal type
type Drinks = 'Coke' | 'Milk' | 'Water' | 'Coffee';
type UnUnite<T, K> = T extends K ? never : T;
type Result = UnUnite<string | number | boolean, string>; // Result: number | boolean
type HealthDrinks = UnUnite<Drinks, 'Coke'>;
// `infer`
// "destructuring type". "Pattern matching"
{
"editor.scrollbar.vertical": "hidden",
"editor.scrollbar.horizontal": "hidden",
"editor.renderLineHighlight": "gutter", // Highlights the gutter
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#fff", // Background color of the current line
"editor.lineHighlightBorder": "#eee", // Optional: Border color around the current line (can be removed if not needed)
"statusBar.background": "#e5e5e5"
},
"editor.quickSuggestionsDelay": 0,
@tlkahn
tlkahn / elf_format_cheatsheet.md
Created March 15, 2024 11:52 — forked from x0nu11byt3/elf_format_cheatsheet.md
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@tlkahn
tlkahn / README.md
Created June 22, 2022 00:40 — forked from PurpleBooth/README.md
A github workflow pipeline for rust that does test, build and deploy windows, linux and mac, creates releases, and does SemVer Versioning, and releases to a homebrew tap

Features

  • Automatically bump SemVer
  • Update a personal homebrew tap
  • Keep that pesky version in the Cargo.toml up to date
  • (From dependabot) Get new versions out as soon as possible

Assumptions

  • You don't want a changelog
@tlkahn
tlkahn / tmux-cheatsheet.markdown
Created June 10, 2022 02:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname