Skip to content

Instantly share code, notes, and snippets.

View elibroftw's full-sized avatar
😮‍💨

Elijah Lopez elibroftw

😮‍💨
View GitHub Profile
@elibroftw
elibroftw / casefold.py
Created December 3, 2025 22:25
Case Fold JavaScript. Note that I decided to use normalize because u and ü should match each other when a user is filtering items. In casefolding, they are still distinct characters which makes this a waste of work.
#!/usr/bin/env python3
"""
Parse CaseFolding.txt and generate a TypeScript file with case folding mappings.
https://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt
This script reads the Unicode CaseFolding.txt file and creates a TypeScript
module with mappings for case-insensitive string comparison.
"""
@elibroftw
elibroftw / install_caddy.yml
Created March 27, 2026 04:10
How to Install Caddy on Almalinux via Ansible Playback
- name: NAME
hosts: HOSTS
become: yes
tasks:
- name: Install copr
ansible.builtin.dnf:
name:
- 'dnf-command(copr)'
- 'dnf-plugins-core'
state: present
@elibroftw
elibroftw / Win32WindowHelper.cs
Created April 1, 2026 20:22
Just install CsWin32, add the dpi method to NativeMethods.txt
using Microsoft.UI.Xaml;
using System;
using System.Runtime.InteropServices;
internal partial class Win32WindowHelper
{
private static WinProc? newWndProc = null;
private static nint oldWndProc = nint.Zero;
private POINT? minWindowSize = null;
@elibroftw
elibroftw / Win32WindowHelper.cs
Created April 1, 2026 20:22
A reference for what to do if WinUIEx isn't enough. Just install CsWin32, add the dpi method to NativeMethods.txt
using Microsoft.UI.Xaml;
using System;
using System.Runtime.InteropServices;
internal partial class Win32WindowHelper
{
private static WinProc? newWndProc = null;
private static nint oldWndProc = nint.Zero;
private POINT? minWindowSize = null;
@elibroftw
elibroftw / rank_anything_top_10.py
Last active April 7, 2026 00:41
An easy way to rank items of your choosing, such as movies, tv shows, food/dishes.
import os
import itertools
import csv
MOVIES = '/media/elijah/Big Dipper/Videos/Movies'
TV_SHOWS = '/media/elijah/Big Dipper/Videos/TV Shows'
SELECTION = MOVIES