Skip to content

Instantly share code, notes, and snippets.

View WestonThayer's full-sized avatar

Weston Thayer WestonThayer

View GitHub Profile

Installation

  1. Download http://westonthayer.com/tmp/BloksBeta.zip
  2. Unzip to
    • On a PC: %appdata%\Adobe\CEP\extensions\
    • On a Mac: ~/Library/Application Support/Adobe/CEP/extensions/
  3. Rename the folder from BloksBeta to com.westonthayer.bloks
  4. Enable unsigned Adobe CEP extensions
    • On a PC: open the registry editor (<WINKEY + R> then regedit) and add a value at HKEY_CURRENT_USER\SOFTWARE\Adobe\CSXS.6 of type REG_SZ and value PlayerDebugMode. Set the data to 1
  • On a Mac: in Terminal, run defaults write com.Adobe.CSXS.6 PlayerDebugMode 1
@WestonThayer
WestonThayer / minimum-type-size.md
Created November 10, 2017 20:12
Saved out from the Nice Web Type Slack so I don't forget...

i stumbled across that article (https://www.imarc.com/blog/best-font-size-for-any-device) too, while trying to find guidance around minimum type sizing. to get actionable data, i combined

  • info on what devices our customers were using / we wanted to support
  • the x-height font metric for our typeface
  • the above research on minimum viewing angle that @jpamental cited
  • https://material.io/devices/ (click on a row to see Screen distance and dp/in, which should match css px/in)

assuming you trust Google's Screen distance values are accurate for that device's average viewing distance, you can track down the device with the highest dp/in you want to support in a particular viewing distance bucket, then choose your minimum font-size to fit it

there isn't a great way to target a "viewing distance bucket", but i thought normal viewport width media queries worked ok

Two phones, side by side, showing a list of missed phone calls. It animates the content's zoom from 100% to 500%. The left phone magnifies font-size and margins, which becomes very hard to read above 200%, while the right phone only magnifies font-size and is much easier to read above 200%
Screen recording of Samsung Internet browser running on a Galaxy S9. The web page showing has text sized with px and rem. When the browser's Text Size setting is increased to 200%, all text is doubled in size, regardless of whether px or rem was used.
@WestonThayer
WestonThayer / instructions.md
Created August 9, 2019 01:01
App to get Windows scancodes

How to compile

On a Windows machine, you'll first need Visual Studio (the free version is fine). Once that's complete:

  1. Open a command prompt
  2. Find vcvarsall.bat in your VS installation path, then call it with x64 as it's argument. It will look something like: call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x64
  3. Run cl main.c -nologo -Zi -link user32.lib

That should compile and generate main.exe.

// All tests visiting a page with this HTML:
//
// <p>content before</p>
//
// <ol id="target">
// <li>
// Cats
// <ol>
// <li>Big cat</li>
// <li>Small cat</li>
@WestonThayer
WestonThayer / typing.applescript
Created December 14, 2020 19:49
MacOS Automator AppleScript for typing
# Using MacOS Automator to type in any application. Useful for
# apps that don't support pasting
#
# To configure:
#
# 1. Open Automator
# 2. Create a new Quick Action (formerly known as a Service)
# 3. Workflow receives: no input
# 4. in: any application (you may need to grant Automator Accessibility
# access in System Preferences)
(*
VoiceOver Translator
Version: 1.1
Copyright 2020 Tyflos Accessible Software. All rights reserved.
You may incorporate this Tyflos Accessible Software sample code into your system and program(s) without restriction.
This sample code has been provided "AS IS" and the responsibility for its operation is yours.
You are not permitted to redistribute this Tyflos Accessible Software sample code as "Tyflos Accessible Software sample code" after having made changes. If you're going to redistribute the code, we require that you make it clear that the code was descended from Tyflos Accessible Software sample code, but that you've made changes.
@WestonThayer
WestonThayer / _app.jsx
Last active March 14, 2022 21:06
Basic Next.js focus restoration
// Browsers keep track of where your keyboard focus is when you click
// a link, and they restore focus to the same link when you navigate
// back (via https://web.dev/bfcache/)
//
// SPAs like Next.js break this paradigm because they handle routing
// themselves. This is a basic approach bringing the feature back. It
// doesn't handle restoring the view-state (well, Next.js handles
// scroll restoration out-of-the-box, but that's it) like re-opening
// dropdowns or dialogs or FAQ items that contained the clicked link.
@WestonThayer
WestonThayer / android-in-cloud-for-talkback.md
Last active September 9, 2021 19:09
Notes on running Android emulators in the cloud for testing TalkBack

Twitter thread for context: https://twitter.com/__grunet/status/1434197313795330049

Q: Is it possible to run the Android Emulator in the cloud?

A: Yes, either in a bare metal cloud or with nested virtualization.

Q: Is it easy to set up?

A: Sort of, I'm sure a lot of it could be scripted. https://github.com/budtmo/docker-android has put a lot of work into making it fast once you have a Linux machine ready (I didn't test it). With nested virtualization, you could do these steps once and take a VM image.