Skip to content

Instantly share code, notes, and snippets.

View Chudesnov's full-sized avatar

Alexander Chudesnov Chudesnov

View GitHub Profile
@mcking65
mcking65 / modeless_dialog_proposal.md
Last active August 31, 2023 15:05
An Accessibility Opportunity Hidden in Modeless Web Dialogs

An Accessibility Opportunity Hidden in Modeless Web Dialogs

In the current effort to resolve issues related to standardizing web dialogs (see ARIA issue 1708), it is proposed that the ARIA specification recommend that browsers and screen readers treat modeless dialogs as landmark regions. While the discussion has surfaced some potential benefits to modeless dialog landmarks, I believe equating modeless dialogs and landmark regions is not an optimal path. I might even go so far as to call it a huge mistake. That path would preclude extremely valuable user benefits that can only be realized if screen readers do not render boundaries of modeless dialogs the way they render boundaries of landmark regions.

If ARIA were to standardize modeless dialogs as landmark regions, we would give web authors yet another construct for doing little more than labeling a group of elements within a page. Yet, non-web platforms offer other grouping constructs with a different set of sc

Batching makes it difficult to perform imperative actions like focus

Solution to the problem discussed with Dan Abramov here.

implementation:

export default function useQueueFocus(): (elementRef: React.MutableRefObject<HTMLElement | null>) => void {
  const isUnmountedRef = useRef(false)
  const forceUpdate = useForceUpdate()
  const ref = useRef<MutableRefObject<HTMLElement | null> | undefined>(undefined)
@TheRadziu
TheRadziu / ultimate-vita-comparison.md
Last active October 27, 2024 05:32
Ultimate Vita Comparison (Firmwares & Rips vs Dumps)

Due to so many misinformation, false claims and confusion that goes around the web I've decided to make this quick comparison of all most known backup enabling tools, hackable vita firmwares and which one you should be using and why.
Date of last update: 13.01.2020

NoNpDRM Rips vs Dumps

NoNpDRM Rips Vitamin / MaiDumpTool Dumps
All original files untouched
Support Retail DLCs
Support Ripped (NoNpDRM) DLCs
Support Dumped (Vitamin/Mai) DLCs 1
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@tenphi
tenphi / bemnames.js
Created September 2, 2017 11:25
BEM-class Generator for React
import classNames from 'classnames';
// modName -> mod_name
function toKebabCase(str) {
return str ? str.replace(/[A-Z]/g, function(s) {return '-' + s.toLowerCase() }).replace(/$\-/, '') : '';
}
function BEM(blockName) {
blockName = blockName || '';
@obenjiro
obenjiro / validation.md
Last active May 8, 2018 06:19
Валидация: Эра Парсеров
@JamieMason
JamieMason / migrate-to-lerna.sh
Last active April 25, 2019 18:58
Bash script to migrate multiple projects into one Lerna monorepo (https://lernajs.io)
#!/usr/bin/env bash
set -x
shopt -s extglob dotglob
cd "$HOME"
rm -rf "$HOME/TEMP_DIR"
mkdir "$HOME/TEMP_DIR"
cd "$HOME/TEMP_DIR"
git init
@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
@A-gambit
A-gambit / REACTIVE2016-LIGHTNING-PROPOSAL.md
Last active February 22, 2024 18:24
Proposal for lightning talk at ReactiveConf 2016: Road from UndefinedLand

Proposal for a lightning talk at the Reactive 2016.

Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.

Road from UndefinedLand

Undefiend

I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.

@marcysutton
marcysutton / chrome-a11y-experiment-instructions.md
Last active January 31, 2023 22:07
Enable Chrome Accessibility Experiment

NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y


Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.

As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)

To enable the accessibility inspector in Chrome stable: