Skip to content

Instantly share code, notes, and snippets.

View lxe's full-sized avatar
🦀
Crab

Aleksey Smolenchuk lxe

🦀
Crab
View GitHub Profile

Claude's inanimate-subject cadence: a two-scale rating

Data: 1,861 Claude Code transcripts in ~/.claude/projects (~697,000 prose sentences from Claude's chat replies and from docs, READMEs, and site copy Claude wrote).

Each example below is rated on two independent axes:

  • Personification (P0–P4): whether the grammatical subject can literally perform the verb.
  • Referent clarity (R0–R2): whether a reader can tell right away what "it", "both", "that", or "its X" refers to.

A sentence can be fine on one axis and awkward on the other. In "The loop guards against both", a loop can literally guard against a failure mode (P0), but a reader has to reread the previous sentence to reconstruct which two failure modes "both" refers to (R1).

@lxe
lxe / README.md
Last active November 14, 2026 19:26
Sharp, low-latency macOS desktop streaming with Moonlight on fractional-scale Hyprland: geometry, encoder profiling, ICC color correction, input, and recovery

A sharp, low-latency Mac desktop in Moonlight on fractional-scale Wayland

This setup streams a Mac desktop into a fixed-size Moonlight window on a Linux workstation. The goal is to keep macOS text sharp, preserve a comfortable UI size, and make keyboard and mouse input behave naturally while approaching 120 frames per second. Getting there required custom Moonlight rendering, a corrected SDL mouse library, compositor integration, and changes to the Mac's encoder and display startup behavior.

These are the settings and measurements from one working installation on November 14, 2026. The Mac is an M1 Max MacBook Pro running macOS 27.0.1. The client is an Arch Linux workstation with an RTX 5090, an i7-13700, and a 7680×2160 monitor at 120 Hz. Hyprland uses a scale of 4/3. That fraction matters: a logical desktop coordinate covers 1⅓ physical screen pixels.

The custom client is based on Moonlight Qt v6.2.0, commit de2467e433821664cdd2224aad8c89a625be1ad9. The Mac runs signed Sunshine prerelease **2

@lxe
lxe / video_minimax_h3_larry_6step_rtx_harbor_8s_shareable.json
Created August 11, 2026 23:59
Clean ComfyUI MiniMax H3 Larry 6-step RTX harbor workflow with embedded prompt
{
"id": "7b88e2df-e2f9-47bc-99cb-273e773f9567",
"revision": 0,
"last_node_id": 21,
"last_link_id": 25,
"nodes": [
{
"id": 1,
"type": "UNETLoader",
"pos": [
@lxe
lxe / bun-middleware.ts
Last active November 15, 2025 14:12
bun-middleware.ts
// TODO: somehow enforce ordering at compile time
type WriteOnly<T> = {
-readonly [K in keyof T]: T[K]; // TODO: Typescript can't block setters like this natively :)
};
type RouteHandler<T extends string> = ( // TODO: Extract from Bun... I think it has this built in
req: Bun.BunRequest<T>,
server: Bun.Server,
) => Response | Promise<Response>;
/* Use the browser to make signed requests to the API directly, avoiding full page reloads, saving a ton of time. Rough steps:
1. Open the _app chunk in devtools sources
2. Search for 'refreshBox' string
3. Set a breakpoint around the 'var o = n(32862);'
4. Export the 'o' local as a temp1 global var.
5. Remove the breakpoint and continue
6. Determine the starting set_no in the batch
7.Run something like this in the browser console:
@lxe
lxe / ConditionalGroup.tsx
Last active January 3, 2025 04:54
Conditional Component Group
import React, { useState } from 'react';
// First, let's define our conditional components
const C = ({ if: condition, elseif: elseIfCondition, else: isElse, children }) => {
if (condition !== undefined && condition) {
return <>{children}</>;
}
if (elseIfCondition !== undefined && elseIfCondition) {
return <>{children}</>;
}
@lxe
lxe / mac.ahk
Created July 11, 2024 17:18
Make Windows be like Mac
#NoEnv ; Disables the automatic inclusion of certain predefined variables and functions.
SendMode Input ; Sets the SendMode to Input, which allows for more reliable sending of keystrokes.
SetWorkingDir %A_ScriptDir% ; Sets the working directory to the directory containing the script.
; Function to map Windows key combined with another key to the corresponding Ctrl key combination.
; If Shift key is not pressed, it sends Ctrl+key combination.
; If Shift key is pressed, it sends Win+key combination using the {Blind} option to prevent triggering the Windows key menu.
MapWinToCtrl(key) {
if (!GetKeyState("Shift", "P")) {
Send ^%key%
@lxe
lxe / README.md
Last active December 20, 2025 13:20
How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.

How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.

This guide actually works well for linux too. Just don't bother with the powershell envs

  1. Download prerequisites

  2. (Windows Only) Open the Conda Powershell.

@lxe
lxe / README.md
Last active July 8, 2025 21:30
Disco Diffusion Tips