Skip to content

Instantly share code, notes, and snippets.

View klamping's full-sized avatar

Kevin Lamping klamping

View GitHub Profile
@klamping
klamping / string-update-prompt.md
Created September 1, 2026 16:46
LLM Prompt for String Updates

I'm working on a project to update/modify multiple strings in the 'Settings'/'Preferences' components. Below, you'll find a list of string updates that need to be made, with what Pane/Section they're in. For any strings where the given old content matches the suggested new content, skip that setting.

Each string update requires the following steps be completed. Delegate tasks to sub-agents where applicable (e.g., searching for string ids and HTML files).

  1. Identify the relevant fluent ID in the .ftl file based on the old string, along with the corresponding data-l10n-id and possibly search-l10n-ids attribute(s) in the .html file. 1a. Some user-provided strings include interpolations. For example: Show the Start page when Thunderbird opens is actually Show the Start page when { -brand-short-name } opens. 1b. If there are multiple IDs with the same string, we need to narrow down which ID is the relevant one. Present the user with User Prompt A for clarification. Recommend an answer if possible, ba
@klamping
klamping / README.md
Last active July 23, 2026 14:55
Code review skill

Installation

  1. Save the code-review.md file to your ~/.config/opencode/commands/ folder
  2. Reload OpenCode

Usage

In your comm repo, check out the patch you want review. E.g., moz-phab patch D312003 --apply-to main

In OpenCode, start a new session (/new) and type /code-review

https://www.dropbox.com/scl/fi/5pmrcr8ay4qkodjkwwhn1/snow-profile.jpg?rlkey=r3297ac334m78jfkximze0rat&st=s2zmpdek&dl=0
@klamping
klamping / tips.md
Last active January 23, 2024 18:22
Testing tips

Tests need to be reliable most of all, and easy to debug second of all. An unreliable test is an absolute pain.

Optimize tests for readability and debugging

  • That's where you'll spend the majority of your time (and frustration)- Your tests should not make you think
  • Test failures will happen at the worst time. Don't make it even more stressful

Prefer hard-coded values in assertions, versus dynamic content

@klamping
klamping / issues.md
Last active July 13, 2022 23:08
Cypress Complaints
  • Weird nature of Cypress promises that aren't promises, are sometimes chained, and sometimes uses .then
    • Inability to use await/async
  • Inability to use standard variables
    • Getting values from the page is a pain
      • Getting a URL
      • const href = await $('a').getAttribute('href');
      • cy.get('a') .invoke('attr', 'href') .should('eq', 'https://docs.cypress.io') But not really because we can't use that elsewhere so need a better example
@klamping
klamping / testing.md
Last active November 6, 2023 21:00
UI Testing Issues

What makes UI Testing complicated

  • Flaky data
    • Makes debugging incredibly tough when tests pass intermittently
    • Mocking exists, but it's tricky to implement because most data is server-side and you may not have access to that (even if you can change it, it's technically complex)
      • Integrating Server-side Mocking into CICD is complex
  • Loose-coupling between HTML and Selectors (leading to false failing tests/maintanence nightmares)
  • You either have tests that don't prove anything, or tests that are always breaking
    • 3rd-party services that you need to mock, but also need to validate work
    • How do you prove that the right value was returned without either mocking it out or tight-coupling with the API/DB?
  • All the environments in the world
@klamping
klamping / text-replay.scpt
Last active July 11, 2022 23:58
Text Replay
try
set getClip to the clipboard as text
on error
set getClip to " "
end try
tell application "System Events"
repeat with i from 1 to count characters of getClip
keystroke (character i of getClip)
delay (random number from 0.02 to 0.05)
@klamping
klamping / getScrollPos.js
Last active October 7, 2021 21:16
Browser Scroll Bookmarklets
javascript:void function()%7Bconst e%3DMath.round(document.documentElement.scrollTop),o%3Ddocument.createElement("textarea")%3Bo.value%3De,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)%7D()%3B
@klamping
klamping / example.js
Created October 23, 2020 19:02
Example of test generator
function runTest (options) {
browser.url(options.siteUrl);
options.inputs.forEach(input => {
$(input.selector).setValue(input.value);
});
$(options.submitSelector).click();
}
@klamping
klamping / docker-compose.yml
Last active December 27, 2022 17:18
Learn WebdriverIO Docker Compose
version: '3'
services:
web:
container_name: realworld-web
restart: always
image: klamping/realworld-web
environment:
- APIURL=local
ports:
- "8080:8080"