Skip to content

Instantly share code, notes, and snippets.

View christopherball's full-sized avatar

Christopher Ball christopherball

View GitHub Profile
@christopherball
christopherball / command.sh
Created April 2, 2026 21:30
Creates a "dark mode" color-inverted PDF copy based on an original input PDF (presumably with light pages) using the ghostscript terminal command.
gs -o output.pdf -sDEVICE=pdfwrite \
-dDownsampleColorImages=false \
-dDownsampleGrayImages=false \
-dDownsampleMonoImages=false \
-dAutoFilterColorImages=false \
-dAutoFilterGrayImages=false \
-dColorImageFilter=/FlateEncode \
-dGrayImageFilter=/FlateEncode \
-dMonoImageFilter=/CCITTFaxEncode \
-dEncodeColorImages=true \
@christopherball
christopherball / chatgpt-clipper.css
Created March 25, 2026 23:27
This template and stylesheet are designed to smoothly export and cleanly display markdown versions of ChatGPT web sessions within Obsidian using the browser extension Obsidian Web Clipper.
/* Reading mode */
.markdown-rendered h2:has(.cgpt-prompt) {
border-left: 4px solid #4da3ff;
padding-left: 10px;
margin-top: 1.4em;
margin-bottom: 0.6em;
}
.markdown-rendered h2:has(.cgpt-response) {
border-left: 4px solid #ff9d4d;
@christopherball
christopherball / script.js
Last active February 22, 2026 17:28
Google Sheets Dark Mode Lite (Violentmonkey Script)
// ==UserScript==
// @name Google Sheets Dark Mode Lite
// @namespace Violentmonkey Scripts
// @match https://docs.google.com/spreadsheets/*
// @grant none
// @version 1.1
// @description Adds some basic tinting to the spreadsheet interface to save our eyeballs.
// ==/UserScript==
(function () {
@christopherball
christopherball / CUSTOM_TOOLS.hpprgm
Created December 18, 2025 18:20
HP Prime PPL Custom Menu Shortcuts - Can be used to take over the "Menu" key on the HP Prime Calculator in user mode.
// 1. Declare the global variable at the very top of the file
EXPORT MenuOpen := 0;
EXPORT CUSTOM_TOOLS()
BEGIN
LOCAL N, L;
L := {"COMB", "PERM", "!", "RANDINT", "RANDOM"};
// 2. Check the lock: if it's 1, another instance is already running
IF MenuOpen == 1 THEN
@christopherball
christopherball / CommandExamples.sh
Created July 3, 2024 22:17
Using Mac OS terminal command 'rsync' to cleanly copy only 'different' files between two folder locations, excluding git stuff. Useful for Github Page deployments when using standalone repositories.
# DRY RUN COPY DIFF
rsync -v -a -i -n --exclude ".git/" --exclude ".gitignore" ~/Source/ ~/Destination/
# REAL RUN COPY DIFF
rsync -v -a -i --exclude ".git/" --exclude ".gitignore" ~/Source/ ~/Destination/
@christopherball
christopherball / __init__.py
Created June 9, 2024 15:22
Anki Bulk Add Kanji - This add-on is designed to examine specified fields and create a composite set of kanji in the order discovered.
# HOW TO USE:
# This Anki add-on will calculate the kanji (order preserved) contained in a specified
# set of note fields. To set this up, you can simply place this file within a folder
# named "BulkAddKanji" under the Anki add-ons folder. When you start Anki up
# fresh after doing so, a new menu item will be present when in browse mode, entitled
# "Bulk-Add Kanji". Take note of the "fieldToPopulate" and "fieldsToExamine"
# toward the top of this file for insight into where this add-on examines / populates.
# The "fieldToPopulate" is both populated on the event of adding a new card, and can
# also be triggered via the menus when in the browser.
@christopherball
christopherball / pdfDarkModeToggles.js
Created January 6, 2024 17:06
Browser-Based Dark Mode PDF Viewer Toggles
// Both of the following approaches "invert" PDF colors when viewed in the browser.
// Simply execute in browser console or create bookmarklet to trigger on-demand.
// Approach #1 (Slightly more complex)
function togglePDFDarkMode() {
var cover = document.createElement("div");
let inversion = `
position: fixed;
pointer-events: none;
top: 0;
@christopherball
christopherball / __init__.py
Last active December 7, 2020 22:31
Anki Bulk Add Unique Kanji - This add-on is designed to examine specified fields and create a composite unique set of kanji for use with tools such as Morphman for i+1 comprehension.
# HOW TO USE:
# This Anki add-on will calculate the unique set of kanji contained in a specified
# set of note fields. To set this up, you can simply place this file within a folder
# named "BulkAddUniqueKanji" under the Anki add-ons folder. When you start Anki up
# fresh after doing so, a new menu item will be present when in browse mode, entitled
# "Bulk-Add Unique Kanji". Take note of the "fieldToPopulate" and "fieldsToExamine"
# toward the top of this file for insight into where this add-on examines / populates.
from aqt.qt import *
from aqt.utils import showInfo
@christopherball
christopherball / __init__.py
Last active August 17, 2021 10:06
Anki Bulk Add Readings Enhanced - This is a complete re-write of the Japanese Support "Bulk Add Readings" functionality to natively support simultaneous / multiple field reading generation.
# HOW TO USE:
# Simply create a new sibling folder named "BulkAddReadingsEnhanced" in the same
# directory as the popular "Japanese Support" "3918629684" folder. Place this file
# inside said "BulkAddReadingsEnhanced" folder. Once Anki loads, a "Bulk Add Readings
# Enhanced" menu option will be visible, driven by the config used for "Japanese Support".
# This script requires that the srcFields and dstFields have the same number of
# entries. The first srcField maps to the first dstField, etc. This allows
# for unlimited reading generations within a single note type within Anki.
# Should the authors of the original Japanese Support add-on see this, by
# all means, feel free to re-integrate this into the base add-on.