Skip to content

Instantly share code, notes, and snippets.

View danielrosehill's full-sized avatar

Daniel Rosehill danielrosehill

View GitHub Profile

Macropad Button to F13 Key Mapping

Problem

A macropad (HID 5131:2019) was sending KEY_2 (scancode 7001f) when a button was pressed, but needed to send F13 instead.

Solution

Use udev's hwdb (hardware database) to remap the scancode to F13.

Steps

Speech To Text (STT): Basic Text Cleanup / Remediation Prompt: V3 (28/Sep/2025)

You are a helpful writing assistant.

Your purpose is to lightly edit texts provided by the user. The texts which you will be receiving were generated using speech to text technology. Your function is to lightly edit the texts to improve their readability and intelligibility.

Your overarching objective is to take "raw" text and reformat it for readiability.

Editing Instructions

@danielrosehill
danielrosehill / custom-gpt-scraper.js
Last active September 27, 2025 21:05
Scrape your custom GPTs
(async () => {
// ---------- helpers ----------
const sleep = ms => new Promise(r => setTimeout(r, ms));
const ABS = u => new URL(u, location.href).href;
const norm = s => (s || '').replace(/\s+/g, ' ').trim();
const clean = s => s.replace(/\u200b/g,''); // strip zero-widths
// Prefer clean text from a node without kids (or use innerText)
const textOf = (el) => {
if (!el) return '';
@danielrosehill
danielrosehill / custom-gpts-in-new-tab.js
Created September 27, 2025 20:25
Tampermonkey - open custom GPTs in a new tab
// ==UserScript==
// @name Force new tabs on chatgpt.com/gpts/mine
// @namespace daniel.utils
// @version 1.0
// @description Opens clicked links in new tabs on the specified page, even if the site uses SPA routing.
// @match https://chatgpt.com/gpts/mine*
// @run-at document-start
// @grant none
// ==/UserScript==
@danielrosehill
danielrosehill / date-notation.md
Created September 12, 2025 08:12
date-notation

My Favorite Date Notation

In Memento.js, Day.js

ddd, D MMM

Results in (for eg)

Tues, 5 Sep

@danielrosehill
danielrosehill / windsurf-rules-110925.md
Created September 10, 2025 21:58
Windsurf Rules 11-09-25

Environment & System Configuration

Basic Information

  • User: Daniel Rosehill (danielrosehill.com)
  • Location: Jerusalem, Israel
  • Environment: Kubuntu 25.04 desktop
  • Privileges: Full sudo access. Assume permission to invoke.

System Specifications

@danielrosehill
danielrosehill / opnsense-haproxy.md
Created August 29, 2025 12:37
LAN redirect wiith Opnsense and Haproxy

Opnsense Redirect On Gateway Host Logic

Example problem

Danel installs Homebox on his home network.

Daniel installs it on an Ubuntu VM at 10.0.0.1.

Daniel later realises that his home network config is dumb! He moves the gateway to 10.0.0.1.

@danielrosehill
danielrosehill / tapo-and-rtsp.md
Last active August 25, 2025 17:32
Tapo cams and RTSP

TP-Link Tapo Cams & RTSP - Troubleshooting

Enabling

You can enable RTSP in TP Link Tapo in the documented way (advanced -> cam account -> etc)

What happened to my RTSP feed?

If you try to integrate the RTSP streams with platforms like Home Assistant, Frigate, etc. as generic cameras, you may have noticed that the RTSP is extremely unreliable

@danielrosehill
danielrosehill / qwen3-models.md
Created August 25, 2025 16:18
Qwen 3 Open Router Model Names
Model Name Purpose / Specialization Notes
qwen/qwen3-235b-a22b-2507 Base frontier model 235B parameters (22B active via MoE), July 2025 build. General reasoning + generation.
qwen/qwen3-coder Coding-optimized Trained/fine-tuned for code tasks (multi-language programming support).
qwen/qwen3-coder:free Coding (free tier) Same as above, but with usage caps / lower priority queueing.
qwen/qwen3-235b-a22b-thinking-2507 Long-form / reasoning mode “Thinking” variant optimized for chain-of-thought style reasoning.
qwen/qwen3-235b-a22b-2507 (Instruct tuning) Instructio

Human Readable Timestamps in N8N

From $now

{{ new Date($now).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) }}