Skip to content

Instantly share code, notes, and snippets.

@fnrhombus
fnrhombus / RefreshEnv.cmd
Created June 17, 2023 21:58
refreshenv
// https://github.com/chocolatey/choco/blob/0.10.15/src/chocolatey.resources/redirects/RefreshEnv.cmd
@echo off
::
:: RefreshEnv.cmd
::
:: Batch file to read environment variables from registry and
:: set session variables to these values.
::
:: With this batch file, there should be no need to reload command
@maphew
maphew / Install-Leo-code-download.cmd
Last active October 16, 2023 04:43
**Install Leo on Windows Recipe**. Choose among the .cmd for installing from code download, using git, or pypi release. The last one, `Install-Leo`, has all 3 in one file, so don't run as is.
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
@bohwaz
bohwaz / demo.html
Created October 4, 2024 14:12
Insert images in a MarkDown textarea, and resize them before upload, with no specific handling on the server side
<!DOCTYPE html>
<html>
<head>
<title>Javascript insert images into markdown with resize before upload</title>
</head>
<body>
<pre><h2>This demo shows how you can easily add images to a markdown textarea</h2>
You can drag and drop, paste or select images. Files other than images are discarded.
The images are resized on the client side and inserted as Markdown inside the text.
#!/usr/bin/env bun
"use strict";
const fs = require("fs");
const { execSync } = require("child_process");
const path = require("path");
// ANSI color constants
const c = {
cy: '\033[36m', // cyan
@maphew
maphew / README.md
Last active September 18, 2025 19:56
Bookmarklet observation tool, creates json dump of the current page

Bookmarklet tool modelled after a Playwright observer script (Node), generated by Chat GPT 5.

It crawls the page, saves DOM inventory, visible text, local/session storage, IndexedDB list, layout metrics, screenshots, and a HAR.

I used it to record a page on localhost development server, feed the dump to ChatGPT, and have it create a specification of the web app.

Prompt:

Analyse this observer json dump of a local web app and write up the specifications into the "specs/" 
folder with each domain topic (including technical topic) as a seperate markdown file. Create a 

Meta-Prompt for Refining AI Prompt for Model-Specific Use

You are an AI LLM tasked with refining the provided input prompt to optimize it for your own specific capabilities and knowledge. The input prompt describes a software engineering environment with tools, modes, rules, and objectives for task execution. Your goal is to create a streamlined version of the prompt that retains all critical information necessary for effective task execution while removing redundant or obvious content based on your understanding. The refined prompt must remain compatible with the original structure and be usable by you for tasks in the specified environment.

The prompt you refine will be accompanied by other details about your role that will be filed separately. It is expected that you will be able to perform your role perfectly with the supplemental role and rules, alongside this prompt you will refine for yourself.

Instructions

  1. Analyze the Input Prompt:
  • Review the input prompt for sections: Tool Us