Skip to content

Instantly share code, notes, and snippets.

@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active March 18, 2024 05:21
Hacking the LG Monitor's EDID

preface: Posting these online since it sounds like these notes are somewhat interesting based on a few folks I've shared with. These are semi-rough notes that I basically wrote for myself in case I ever needed to revisit this fix, so keep that in mind.

I recently bought an LG ULTRAGEAR monitor secondhand off of a coworker. I really love it and it's been great so far, but I ran into some minor issues with it in Linux. It works great on both Mac and Windows, but on Linux it displays just a black panel until I use the second monitor to go in and reduce the refresh rate down to 60 Hz.

This has worked decent so far but there's some issues:

  • It doesn't work while linux is booting up. The motherboards boot sequence is visible just fine, but as soon as control is handed over to Linux and I'd normally see a splash screen while I'm waiting for my login window, I see nothing.
  • It doesn't work on the login screen. This would be fine if login consistently worked on my second screen, but I need to manually switch
@postspectacular
postspectacular / 004.js
Last active March 7, 2024 06:32
#HowToThing #004 Creating text-based plots to debug & visualize sequential data in a REPL-driven workflow. Here we're using https://thi.ng/dsp signal generators, but any numeric array or iterable will work...
// $ node
// Welcome to Node.js v20.5.1.
// Type ".help" for more information.
const { barChartHStr, lineChartStr } = await import("@thi.ng/text-canvas");
const { adsr, osc, modOsc, rect, saw, sin, tri } = await import("@thi.ng/dsp");
// display line plot of 100 samples from an amplitude-modulate sine oscillator
console.log(lineChartStr(20, modOsc(sin, 0.01, 0, osc(sin, 0.2)).take(100)));
// ╭╮ ╭╮ ╭╮ ╭╮
@kconner
kconner / macOS Internals.md
Last active March 22, 2024 22:58
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@tonyallan
tonyallan / $README.md
Last active April 2, 2022 15:16
Python 3 update for Peter Norvig's Python Lisp
python3 lispytest.py
python3 lispy.py factorial.lsp

Source pages are:

  • https://norvig.com/lispy.html
  • https://norvig.com/lispy2.html
@dbrookman
dbrookman / build-mpv_silicon.sh
Last active March 20, 2024 15:14
How to build mpv & mpv.app on an Apple silicon Mac
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
@JustinGrote
JustinGrote / MandatoryProperties.ps1
Last active February 2, 2024 06:41
A Powershell Class with Mandatory Properties by Default
using namespace System.Collections
using namespace System.Management.Automation
using namespace System.ComponentModel.DataAnnotations
using namespace System.Runtime.Serialization
class MandatoryProperties {
MandatoryProperties([IDictionary]$properties) {
$this.GetType().GetProperties([System.Reflection.BindingFlags]'Instance,Public') | ForEach-Object {
$propertyName = $PSItem.Name
[bool]$isOptional = $PSItem.GetCustomAttributes([OptionalFieldAttribute], $true).count -gt 0
if (
@Ciantic
Ciantic / offsetRelativeTo.js
Created October 22, 2021 11:15
Get offset relative to selector or window
/**
* Get offset relative to selector (or window)
*
* @param {HTMLElement} el
* @param {string|undefined} selector if not give, assumes root most (window)
*/
function offsetRelativeTo(el, selector) {
let offsetTop = el.offsetTop;
let offsetLeft = el.offsetLeft;
let offsetParent = el.offsetParent;
@calicoday
calicoday / playground.js
Last active November 12, 2021 19:33
Refactored tree-sitter playground.js
// Dev switch for loading prev state or force canned eg.
let activateSaveState = true;
let showParseCount = true;
// Prelim sample input, drawn from the cli/src/tests/query_test.rs (as-is, excess space).
const eg = {
lang: 'javascript',
code: `
class Person {
// the constructor
@bitonic
bitonic / vectorized-atan2f.cpp
Last active December 12, 2023 17:11
Vectorized & branchless atan2f
// Copyright (c) 2021 Francesco Mazzoli <f@mazzo.li>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
class DirectedGraph<T> {
readonly edges: Map<T, Set<T>> = new Map();
addAll(from: T, ...to: T[]) {
let dependencies = this.edges.get(from);
if (dependencies == null) {
dependencies = new Set();
this.edges.set(from, dependencies);
}
Sets.addAll(dependencies, to);