Skip to content

Instantly share code, notes, and snippets.

View Dimfred's full-sized avatar

Dimfred

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 15 columns, instead of 1 in line 7.
Name,Set code,Set name,Collector number,Foil,Rarity,Quantity,ManaBox ID,Scryfall ID,Purchase price,Misprint,Altered,Condition,Language,Purchase price currency
Surgical Skullbomb,ONE,Phyrexia: All Will Be One,243,normal,common,1,78723,98c2b2af-739f-413c-8c36-da6f78df0acb,0.06,false,false,near_mint,en,EUR
Phyrexian Atlas,ONE,Phyrexia: All Will Be One,237,normal,common,1,78795,b5adb509-6ad3-4838-925d-1cafa926b83a,0.07,false,false,near_mint,en,EUR
Basilica Skullbomb,ONE,Phyrexia: All Will Be One,224,normal,common,2,78692,8e2f0ae2-db68-4338-93f9-9d9268cec41e,0.02,false,false,near_mint,en,EUR
Dross Skullbomb,ONE,Phyrexia: All Will Be One,225,normal,common,1,78595,66270dd2-9139-4329-9621-852962836688,0.1,false,false,near_mint,en,EUR
Prophetic Prism,ONE,Phyrexia: All Will Be One,238,normal,common,1,78481,3056ac38-7630-4301-88bb-a012a5b186ed,0.02,false,false,near_mint,en,EUR
Myr Kinsmith,ONE,Phyrexia: All Will Be One,236,normal,common,1,78578,6046e50a-f4c9-4029-a589-62a19371b734,0.12,false,false,near_mint,en,EUR
Dune
@Dimfred
Dimfred / gist:576611a505348f2b057a27bec78da50f
Created February 12, 2026 19:47
claude code in zsh for quick command lookup (shellm, shellm you get it?!?!? alskdjfalskdjfa8f7yg94er8)
#!/usr/bin/env zsh
# shellm - ZSH plugin that intercepts @llm prompts and sends them to Claude
# Usage: put @llm anywhere in your command line, e.g.:
# @llm list files by size
# find . @llm only python files modified today
# The response (a shell command) replaces the entire line for you to review/execute.
SHELLM_MODEL="${SHELLM_MODEL:-haiku}"
@Dimfred
Dimfred / fastaaaaaa.py
Created June 18, 2024 13:06
Python Gotta go fast
import random
import sysconfig
import time
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
class Stopwatch:
def __init__(self):
self.start = time.perf_counter()
@Dimfred
Dimfred / Makefile
Created September 30, 2023 17:44
make help target (parses the makefile itself and prints the target and description, which is provided behind ##)
target1: ## does some stuff
echo target1
target2: target1 ## this wil l only print target2 not target1
echo target2
help: ## prints help for target1 and target2
@grep '##' $(MAKEFILE_LIST) \
| grep -Ev 'grep|###' \
| sed -e 's/^\([^:]*\):[^#]*##\([^#]*\)$$/\1:\2/' \
@Dimfred
Dimfred / reverse_search.sh
Created June 9, 2023 12:43
zsh fzf reverse search (like bash)
reverse_search() {
sel="$( \
cat ${HOME}/.zsh_history \
| grep -i "$BUFFER" \
| cut -d';' -f2 \
| sort \
| uniq -ui \
| fzf)"
[ -z "$sel" ] && return
BUFFER="$sel"
@Dimfred
Dimfred / ansible_vault_decode_from_stdin.sh
Last active December 4, 2022 11:01
Ansible Vault: Read password from stdin and print to stdout
echo password | EDITOR=cat ansible-vault edit --vault-password-file /bin/cat test.vault
@Dimfred
Dimfred / clean_registry.sh
Created September 21, 2022 08:05
Rofi registryv2 clean / delete
#!/usr/bin/env zsh
REGISTRY="<YOU_REGISTRY_URL_HERE>"
sel() {
echo "$1" | rofi -dmenu -multi-select -config "~/.config/rofi/config-multi-select.rasi"
}
PARSE="
import sys
@Dimfred
Dimfred / mk.sh
Last active September 9, 2022 09:17
FZF for lets.yaml and Makefile in one command
#!/usr/bin/env zsh
DISTANCE_COMMAND_DESCRIPTION=15
cmd_parse_lets="
import yaml
with open('lets.yaml', 'r') as f:
commands = yaml.safe_load(f)
commands = commands['commands'].items()
lmax = max(len(k) for k, _ in commands)
@Dimfred
Dimfred / Dockerfile
Created August 3, 2022 10:11
poetry for python3.9 alpine linux (ssh enabled)
FROM python:3.9-alpine
################################################################################
# PYTHON INIT
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
LANG=C.UTF-8 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100
@Dimfred
Dimfred / img_to_text.sh
Created May 10, 2022 15:03
Text from screenshot with tesseract
#!/usr/bin/env sh
main() {
# path to store tmp stuff
dir=/tmp
# tmp path of the img to process by tesseract
out_img=$dir/tesseract_img.png
# output text read from the img
out_txt=$dir/tesseract_text