Skip to content

Instantly share code, notes, and snippets.

@mike-clark-8192
mike-clark-8192 / ccc-greasyfork-publish.md
Last active December 27, 2025 21:21
ccc-greasyfork-publish.md

Assisting the user with GreasyFork script publishing

Note: This document is an informative document meant for edification. You are not yet instructed to take action. Please await further instructions.


Overview

GreasyFork (greasyfork.org) is a platform for hosting userscripts. This guide covers common tasks for assisting users with publishing and managing their scripts.

@mike-clark-8192
mike-clark-8192 / CCC_userjs_guide.md
Last active December 27, 2025 21:20
CCC_userjs_guide.md

Agentic Userscripting Strategy: Using localStorage as a Workspace

Overview

When developing userscripts iteratively with a user, use localStorage as a persistent workspace to store code chunks. This allows you to:

  1. Persist code across page reloads - No need to regenerate code which is currently working
  2. Iterate incrementally - Fix/update individual chunks without rewriting everything (saves tokens and time)
  3. Test quickly - Reload page and re-execute all chunks in page context nearly instantaneously with a single command
@mike-clark-8192
mike-clark-8192 / bashrc_history_settings.bash
Created December 16, 2025 11:57
bashrc history settings
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
HISTSIZE=100000
HISTFILESIZE=100000
export HISTTIMEFORMAT="%F %T "
shopt -s cmdhist
shopt -s lithist
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
export HISTIGNORE="pwd:bg:fg:history:exit:relog:clear"
@mike-clark-8192
mike-clark-8192 / firefox_moz_log_modules.md
Created August 27, 2025 10:34
All Firefox MOZ_LOG module names
3pcbexception:5
AVIFDecoder:5
AccessibleCaret:5
ActivePointers:5
AndroidDecoderModule:5
AnnexB:5
AntiTracking:5
AudioChannel:5
AudioSession:5
@mike-clark-8192
mike-clark-8192 / AndroidLog.xml
Created July 29, 2025 17:42
Android Studio Live Templates for BuildConfig.DEBUG guarded log statements
<templateSet group="AndroidLog">
<template name="dlogd" value="if (BuildConfig.DEBUG) {&#10; android.util.Log.d(TAG, &quot;$METHOD_NAME$: $content$&quot;);&#10;}" description="Log.d(TAG, String)" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME" expression="methodName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
<template name="dloge" value="if (BuildConfig.DEBUG) {&#10; android.util.Log.e(TAG, &quot;$METHOD_NAME$: $content$&quot;, $exception$);&#10;}" description="Log.e(TAG, String, Exception)" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME" expression="methodName()" defaultValue="" alwaysStopAt="false" />
@mike-clark-8192
mike-clark-8192 / clipboard_fmt_privacy_test.html
Created September 29, 2024 16:20
Browser Clipboard API multi-format and privacy tester
<!DOCTYPE html>
<html>
<head>
<title>HTML Clipboard Tester</title>
<style>
body * { margin-top: 10px; font-family: sans-serif; }
input, select, textarea { font-family: sans-serif; }
table, tr, td, th { border: 1px solid black; border-collapse: collapse; }
tr, td, th { padding: 5px; }
</style>
@mike-clark-8192
mike-clark-8192 / $x.js
Created September 28, 2024 07:03
JavaScript port of Chrome Dev Tools `$x`
function $x(selector, contextNode = document) {
// Ensure the selector is provided and is a string
if (!selector || typeof selector !== 'string') {
throw new Error('$x requires a non-empty string as its first argument.');
}
// Ensure the context node is a valid DOM Node
if (!contextNode || !(contextNode instanceof Node)) {
throw new Error('The second argument to $x must be a DOM Node.');
}
@mike-clark-8192
mike-clark-8192 / Clipboard_ExcludeClipboardContentFromMonitorProcessing.html
Created September 27, 2024 19:17
ExcludeClipboardContentFromMonitorProcessing Browser Test
<!DOCTYPE html>
<html>
<head>
<title>HTML Clipboard Tester</title>
<style>
body * { margin-top: 10px; font-family: sans-serif; }
input, select, textarea { font-family: sans-serif; }
table, tr, td, th { border: 1px solid black; border-collapse: collapse; }
tr, td, th { padding: 5px; }
</style>
@mike-clark-8192
mike-clark-8192 / cycle_color_schemes.vim
Created September 13, 2024 17:12
Cycle through Gvim color schemes and display current scheme's name
let g:colors = getcompletion('', 'color')
func! NextColors()
let idx = index(g:colors, g:colors_name)
return (idx + 1 >= len(g:colors) ? g:colors[0] : g:colors[idx + 1])
endfunc
func! PrevColors()
let idx = index(g:colors, g:colors_name)
return (idx - 1 < 0 ? g:colors[-1] : g:colors[idx - 1])
endfunc
nnoremap <silent> <s-a-n> :exe "colo " .. NextColors() \| redraw \| colorsch <CR>
@mike-clark-8192
mike-clark-8192 / commentary.vim
Created September 8, 2024 23:12
Modification of commentary-vim that allows for case-insensitive matching of comment delimiters (e.g., `rem` is no different from `REM` in dosbatch)
" commentary.vim - Comment stuff out
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 1.3
" echomsg "commentary.vim: before g:loaded_commentary=" . get(g:, 'loaded_commentary', 0)
echom a
if exists("g:loaded_commentary") || v:version < 703
finish
endif
let g:loaded_commentary = 1