Skip to content

Instantly share code, notes, and snippets.

View jasonm23's full-sized avatar

Jason Milkins jasonm23

View GitHub Profile
@jasonm23
jasonm23 / Notes on Electron Spawning MPV.exe in Windows.md
Last active December 17, 2025 03:23
Electron spawning mpv as a standalone launched windows app

Running MPV from Electron / Windows

Tested on Windows 11 / mpv.exe is in user path.

Abstract

Running mpv via Electron on Windows, assuming the goal is to run MPV as a standalone so the Electron app can close without affecting mpv.

As opposed to exec, we use spawn as the method to fork the process, spawn returns a stream of io, in this example, we 'ignore' stdio.

@jasonm23
jasonm23 / use-history.tsx
Last active November 15, 2025 10:38
Not sure this already exists, does now: Finite/Wrap Around generic history React hook. - Note this is value history so an abstraction lower than things like browser history.
import { useState, useCallback } from 'react';
interface History<T> {
history: T[];
head: T | undefined;
previous: T | undefined;
next: T | undefined;
addItem: (item: T) => void;
previousItem: () => void;
nextItem: () => void;
@jasonm23
jasonm23 / font-lock-faces.md
Last active October 25, 2025 08:43
Emacs font-lock faces list
Emacs defface htmlfontify css class
font-lock-warning-face warning
font-lock-function-name-face function-name
font-lock-function-call-face function-call
font-lock-variable-name-face variable-name
font-lock-variable-use-face variable-use
font-lock-keyword-face keyword
font-lock-comment-face comment
font-lock-comment-delimiter-face comment-delimiter
@jasonm23
jasonm23 / get_bookmarks_from_firefox.py
Created June 20, 2025 08:45
Get bookmarks directly from firefox places.sqlite WIP
import sqlite3
import os
import json
import argparse
import datetime
import sys # For sys.platform
import shutil # For copying database, if enabled
import configparser # For parsing profiles.ini
def get_firefox_profile_path(profile_name=None, newest=False):
@jasonm23
jasonm23 / copyq-sync-config.md
Last active June 11, 2025 00:49
Configure CopyQ for tab synchronizarion to directory

CopyQ Tab Sync Config from CLI

Sync a Tab to a Directory with copyq, not setable from the cli tool, but is possible in the config.

(linux/macos: ~/.config/copyq/copyq.conf | windows: %APPDATA%\copyq\copyq.conf )

Define tabs

Config will default to 1 tab called &clipboard. The & marks the letter to activate with Alt

@jasonm23
jasonm23 / make-nerd-font-glyphs.js-script.sh
Created May 23, 2025 04:41
Quick curl, jq, fzf script to search for a Nerd Font icon glyph
#!/bin/bash
curl -s https://raw.githubusercontent.com/ryanoasis/nerd-fonts/refs/heads/master/glyphnames.json \
| jq -r 'to_entries | map(select(.key != "METADATA")) | .[] | "\"\(.key)\": \(.value | @json),"' \
| sed 's/^/ /' \
| awk 'BEGIN {print "export const NerdFontGlyphs = {"} {print} END {print "}"}' \
> nerd-font-glyphs.js
@jasonm23
jasonm23 / uv-self-contained-script.md
Created April 10, 2025 02:01
Running a Python script with uv

To run a python script which has dependencies, with uv without extra steps, just execute it.

#!/usr/bin/env -S uv run --script
# /// script
# dependencies = [<array of string names of required modules>]
# ///

# and the rest of the script goes here.
@jasonm23
jasonm23 / gopassbridge-dark-setup-windows.md
Last active October 31, 2024 02:43
GopassBridge-Dark For Firefox on Windows
@jasonm23
jasonm23 / how-to-run-passff-on-windows.md
Last active December 22, 2025 16:26
Running passff on Windows and Firefox

Hi all, Please consider donating to this or any of my many of opensource projects.

Buy Me a Coffee at ko-fi.com

How To run PassFF for Firefox on Windows

Getting it running on Windows is fairly simple, but the browser extension PassFF with its host script, PassFF host didn't work for me after running the installer install_host_app.bat file.

I found gopass which is a Go implementation of the original pass script, and seems to be 100% compatible.

@jasonm23
jasonm23 / ocodo.pwsh.json
Last active June 10, 2025 02:32
Pwsh prompt
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#26C6DA",
"style": "diamond",
"template": "[{{ .UserName }}@{{ .HostName }}] ",