Skip to content

Instantly share code, notes, and snippets.

View kentbrew's full-sized avatar

Kent Brewster kentbrew

View GitHub Profile
@kentbrew
kentbrew / find_intel_applications.md
Last active May 29, 2026 13:22
How to find Intel-based apps that might be triggering the MacOS warning that they won't be supported in a future version.

How to find Intel-based apps that might be triggering the MacOS warning that they won't be supported in a future version.

If you're just now making the jump from an Intel-based Mac to Apple silicon and you use Migration Assistant, you should be aware that if you have a old trail of installs on certain packages (Dropbox and iTerm2 are two) that followed you from previous profiles, you might be in for trouble.

Trouble takes the form of a pop-up warning you that at support is ending for Intel-based apps, and that this version of "ProgramName" will not open in a future release of macOS. If whatever you're using runs automatically every 20 minutes -- looking at you, DropboxUpdateClient -- you will see a lot of these things.

If you are absolutely positively sure you have updated to the Apple Silicon version of whatever-it-is and support is telling you to do things like make a new profile and use it whenever you want to use the app, here's your last resort:

You want System Report, via Apple menu. Then:

@kentbrew
kentbrew / glassy.md
Created May 24, 2026 08:08
Prevent Safari on IOS 26+ from throwing up random blurry colors under the bottom toolbar

Prevent Safari on IOS 26+ from throwing up random blurry colors under the bottom toolbar

Just shipped a site with a whole rainbow of sticky headers that scroll up and down the full width of the page; as they flew by the bottom toolbar would shift through colors not corresponding to the top sticky header and it was annoying.

No good docs or StackOverflow answers that I could see so here's a quick note to Future Me for when I forget how to do this. At the very bottom of your page, add this:

<div class="glassy" style="position:fixed;left:0;bottom:0;right:0;height:5px;z-index:8675309"></div>

My device and simulators seem to be sampling four to five pixels above the bottom edge; a 5px stripe has worked for me so far.

@kentbrew
kentbrew / vertical_centering.md
Last active January 28, 2025 03:31
Hi, what's the best way to vertically center some text on a Web page?

Just asked DeepSeek a question:

Hi, what's the best way to vertically center some text on a Web page?

DeepSeek's answer was pretty solid:

Vertically centering text on a web page can be achieved in several ways, depending on the context and the layout method you're using. Here are some of the most common and effective techniques:

1. Using Flexbox

Flexbox is one of the easiest and most flexible ways to center content both vertically and horizontally.

@kentbrew
kentbrew / tootski.md
Last active March 24, 2025 13:25
Tootski, a sharing bookmarklet for Mastodon

Tootski, a sharing bookmarklet for Mastodon

Kent Brewster

Tootski is a bookmarklet that will share the page you're on to your Mastodon instance, including the title, address, and any text you may have selected. If you have any questions or need help, please find me at https://xoxo.zone/@kentbrew.

Before You Begin

You need to know the name of your Mastodon instance if it's not mastodon.social. To find it, visit your home page on Mastodon and copy out the part between the second and third slash. My home URL looks like this:

/* use strict */
const me = {
// we could potentially set this in game.create from game["_gridWidth"]
// instead of hard-coding the number 24
board: {
height: 24,
width: 24
},
// starting score should be 0
@kentbrew
kentbrew / insta_pinterest_rss.md
Last active March 14, 2023 01:19
Instagram RSS via Pinterest

Instagram RSS via Pinterest

Curious reader @plasticmind asked this question on the Twitter:

Dear lazyweb: does anyone know of a way to pull the Instagram feed for a particular user into a site automatically without needing to pay a monthly subscription for a service? Happy to entertain dev-related options.

The answer is, as always, "it depends." If it's your account, you can do this with Pinterest, and along the way make sure that any time one of your Instagram posts winds up on Pinterest it will have correct attribution.

To get a feed of Instagram posts onto a Web site:

@kentbrew
kentbrew / cookies.md
Last active October 20, 2024 15:55
Quick-read cookies via browser extension

Here's a thing you can do to quickly reveal any or all cookies set on your WebExtensions-compatible browser from any domain. For this example we'll use Chrome but it should work wherever you can debug a browser extension.

You need to have at least one add-on installed that has a background page; to find it, go to chrome://extensions, be sure Developer Mode is on (top right sliding switch) and see if any of your installed extensions has a link to background page next to Inspect Views.

Once you find a link to a background page, click it. A Web inspector should appear; when it does, go to the Console tab and paste this:

chrome.cookies.getAll(
  {domain: "facebook.com"},
 results =&gt; {
@kentbrew
kentbrew / white_elephant.md
Last active December 7, 2021 02:45
The One True White Elephant Gift Exchange Ruleset

The One True White Elephant Gift Exchange Ruleset

Gifts must:

  • Number the exact number of players.
  • Be wrapped so their contents cannot be visually discerned.

Setup:

  • All gifts must be placed in a location where players can see all of them.
@kentbrew
kentbrew / testing_extensions_on_chrome_canary.md
Created November 13, 2019 21:57
Testing Extensions on Chrome Canary

Testing Extensions on Chrome Canary

Kent Brewster, 2019-11-13. For fastest contact, Twitter is your best bet; I'm @kentbrew there and everywhere else that hasn't already kicked me off.

At long last it's time to get serious about Manifest V3:

https://developer.chrome.com/extensions/migrating_to_manifest_v3

https://developer.chrome.com/extensions/migrating_to_service_workers

Problem: all the cool new toys only work in Chrome Canary. If you're like me, your chrome://extensions page is already a giant mass of internally-conflicting test extensions and you dislike the taste of coal dust, so you've avoided Canary versions of Chrome at all costs.

@kentbrew
kentbrew / object_spelunking.md
Last active October 31, 2019 22:04
Avoiding repetition when deciding whether a member exists several layers deep inside an object.

Object Spelunking

This is trouble:

if (foo.bar.baz.woo.yay === 8675309) {
  doStuff();
}