Skip to content

Instantly share code, notes, and snippets.

View JohnDDuncanIII's full-sized avatar

John Duncan JohnDDuncanIII

View GitHub Profile
@JohnDDuncanIII
JohnDDuncanIII / lgc1macos.txt
Created March 12, 2025 00:18
lg c1 macOS 120hz
The new "macOS" product variation of https://www.amazon.com/dp/B0DCN798Y1 allows plug-and-play 4k 120hz 12-bit RGB Full Range HDR10 on my M1 MacBook Pro using an LG C1 through the "Amazon Basics High-Speed HDMI Cable (48Gbps, 8K/60Hz ) - 3 Feet, White" hdmi cable (https://www.amazon.com/gp/product/B08BS181P2).
For optimal performance and lowest possible latency, I would also recommend:
1) Installing BetterDisplay (https://github.com/waydabber/BetterDisplay) — I did this through homebrew ($ brew install --cask BetterDisplay; open -a BetterDisplay)
2) Enabling BetterDisplay's Settings => Displays => LG TV SSCR2 => Edit display role setting, which forces macOS to treat the C1 as a monitor rather than a TV, meaning that Night Shift and True Tone will work.
3) Disabling BetterDisplay's Color Mode => GPU Dithering in the BetterDisplay menu bar dropdown.
4) Downloading Quartz Debug from "Additional Tools for Xcode 16.2" (https://download.developer.apple.com/Developer_Tools/Additional_Tools_for_Xcode_16.2/Additional
update_go() {
ARCH="$(uname -m | sed 's/^..86$$/386/; s/^.86$$/386/; s/x86_64/amd64/; s/arm.*/arm/; s/aarch64/arm64/')"
OS="$(uname | tr "[:upper:]" "[:lower:]" | sed 's/mingw/windows/; s/.*windows.*/windows/')"
# if the $GOROOT environment variable does not exist...
if [ -z "$GOROOT" ]
then
# if go is installed
if [ -x "$(command -v go)" ]
then
<!DOCTYPE html>
<iframe src="data:text/html,
<!DOCTYPE html>
<script>
const d = new Date();
const year = d.getFullYear();
const month = `${d.getMonth() + 1}`.padStart(2, '0');
const day = `${d.getDate()}`.padStart(2, '0');
document.createElementHTML = element => document.createElementNS("http://www.w3.org/1999/xhtml", element)
document.createElementXUL = element => document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", element)
htmlNS = () => document.createElement = document.createElementHTML
// https://bugzilla.mozilla.org/show_bug.cgi?id=1479050
// https://bugzilla.mozilla.org/show_bug.cgi?id=1479538
// https://bugzilla.mozilla.org/show_bug.cgi?id=1631439
// https://developer.thunderbird.net/add-ons/updating/tb78/changes#changed-xul-elements
xulNS = () => document.createElement = (
// Mozilla 63+
// js
const isDarkMode = (
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches
)
window
.matchMedia("(prefers-color-scheme: dark)")
.addEventListener("change", e => {
const colorScheme = e.matches ? "dark" : "light"
/**
* recursively converts DOM nodes into React elements
* @param {(DOM) Node} element the DOM Node
* @param {number} index the unique key
* @param {number} id the ID of the parent Component
*
* @returns {JSX} the new JSX element
*/
const reactify = (element, index, id, disableAnchors) => {
// get attributes of DOM nodes and add them to a map to pass to the React element