Skip to content

Instantly share code, notes, and snippets.

@masonjames
masonjames / unslopify.md
Last active May 7, 2026 23:33
unslopify workflwow for repoprompt
id DE38DEE7-10BB-43D4-B74F-CF47E30CE946
name Unslopify
icon wand.and.stars
tooltip Deep cleanup audit with safe implementation
description Audit and clean code slop across focused lanes: dead code, weak types, cycles, error hiding, legacy paths, bad comments, and obvious duplication.

Unslopify Mode

#!/usr/bin/env bash
set -euo pipefail
# patch-claude-code.sh — Rebalance Claude Code prompts to fix corner-cutting behavior
#
# What this does:
# Patches the npm-installed @anthropic-ai/claude-code cli.js to rebalance
# system prompt instructions that cause the model to cut corners, simplify
# excessively, and defer complicated work.
#
@tokenbender
tokenbender / SKILL.md
Last active April 4, 2026 21:34
Updated global OCR combo: ocr-refiner + pdf-ocr-feedback
name pdf-ocr-feedback
description High-accuracy OCR pipeline using Maj@K consensus voting, structured self-evaluation, and adaptive compute budgets to achieve ≥95% transcription accuracy.

When to Use

Use when transcribing PDF pages via vision model and you need high accuracy — especially for:

  • Equations or mathematical notation
  • Tables with complex structure (3+ columns, merged cells)
- name: Overprovision like the pros'
hosts: all
tasks:
- name: Install early OOM killer and zram
ansible.builtin.apt:
pkg:
- earlyoom
- zram-tools
- name: Configure early OOM killer
ansible.builtin.lineinfile:

A Somewhat More Involved Date Comparison

An example page for https://www.evidence.studio/

Introduction

Many Components now have a "compare to" option, and thats going to serve most purposes, but what if you want to plot a metric over time against a comparison period?

This is definitely more involved, but it solves that case, and allows for a little less repetition in component settings. This is probably not the only way to do it, just an example for anyone that might find it useful

This example only uses the demo_daily_orders source, so can be tried out by anyone

@NatElkins
NatElkins / cloud-init.yaml
Created March 8, 2025 22:09
cloud-init script for VPS
#cloud-config
# Enable automatic package updates and upgrades during cloud-init execution
package_update: true
package_upgrade: true
packages:
# Security and Hardening
- ufw
- fail2ban
@robertvanhoesel
robertvanhoesel / form.ts
Last active November 1, 2025 23:02
Astro createForm implementation
import { getZodConstraint, parseWithZod } from "@conform-to/zod"
import type { HTMLAttributes } from "astro/types"
import { ZodAny, z, type ZodIssue } from "zod"
export type Constraint = ReturnType<typeof getZodConstraint>[0]
export type FieldAttributes = {
name: string
value: string
type: NonNullable<HTMLAttributes<"input">["type"]>
} & Partial<Record<Lowercase<keyof Constraint>, any>>
@faizanakram99
faizanakram99 / QueryHydrator.php
Created January 20, 2024 00:15
DBAL results to object hydrator
<?php
declare(strict_types=1);
namespace HakunaMatata;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Types\Type;
<?php
declare(strict_types=1);
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class SessionListener
{
public function __construct(
@sannajammeh
sannajammeh / Image.astro
Last active June 11, 2025 10:38
Astro Responsive Image
---
import type { ImageMetadata, ImageTransform } from "astro";
import { getImage } from "astro:assets";
import LoadableImage from "./LoadableImage.astro";
type Props = {
src: ImageMetadata;
alt: string;
/**
* Array of screens to generate the image for i.e [320, 480, 1200]