Skip to content

Instantly share code, notes, and snippets.

@holgr
holgr / README.md
Last active March 7, 2026 17:10
macOS process stealing window focus

Sean Harding finally put into words an issue that I've witnessed for a while now on macOS Sonoma.

This is it: "Weird MacOS thing: the window I am working in will sometimes lose focus (without the app losing focus). Suddenly, and without any obvious cause. It will be as if no window has focus. Sometimes happens as often as every few minutes, sometimes doesn't happen for a long time. I can’t figure out any common variable. But it can be very disruptive. Has anyone else seen this? Any ideas?"

I've adjusted the Python script mentioned in the thread to work with Python 3.x that you can get with Homebrew for example.

This is what the output looks like:

@hqf00342
hqf00342 / TextboxDialog.linq
Last active October 11, 2023 17:32
Linqpad multiline textbox dialog
// TextboxDialog for LINQPad
// You can use it anywhere by adding the following code to MyExtensions class on Linqpad6.
// Usage:
// var lines = MyExtensions.ReadLines()
// foreach (var line in lines)
// Console.WriteLine(line);
public static class MyExtensions
{
// Write custom extension methods here. They will be available to all queries.
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active January 7, 2026 08:52
How to recover from messed up python installation on mac, and never have to mess with apple's python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.