Skip to content

Instantly share code, notes, and snippets.

View parthnvaswani's full-sized avatar
🏠
Working from home

Parth Vaswani parthnvaswani

🏠
Working from home
View GitHub Profile
@parthnvaswani
parthnvaswani / AccessibilityChecklist.md
Last active June 17, 2024 12:27
Exhaustive Web Accessibility Checklist

1. Perceivable

Text Alternatives

  • Images: Add alt text to all images that convey information.
  • Decorative Images: Use empty alt attributes (alt="") for purely decorative images.
  • Complex Images: Use longdesc or detailed descriptions for complex images like charts or infographics.
  • Icons: Provide text labels for icon-based buttons.
  • Linked images: Add alt text that details their URL destination, not a description of the image.

Time-Based Media

# Example usage: sh compress_images.sh -i=images -o=compressed_images -w=1280 -e=jpg -f=webp
# Set default values
width="1280"
src="./images"
dest="./compressed_images"
extension="jpg"
output_format="webp"
function print_help {

Interactivity API

Interactivity API is a new API that allows developers to create interactive blocks in WordPress. It is built on top of the Block Editor and provides a way to create blocks that can interact with each other. Before the Interactivity API, developers had to rely on custom JavaScript code to create interactive blocks.

Some configurations are required to use the Interactivity API and its scripts. As @wordpress/intereactivity provides its scripts as js module and we can only import use a module script in another module script.

Custom Interactive Block

To create a custom interactive block using the Interactivity API, you need to follow these steps:

@parthnvaswani
parthnvaswani / Commands.md
Last active February 9, 2023 12:30
Setup PHPCS for WordPress Development

Install PHPCS using composer:

composer g require --dev automattic/vipwpcs dealerdirect/phpcodesniffer-composer-installer -W

Note: If you do not have composer install it using brew:

brew install composer

Edit your .zshrc file and add the following line at the end:

export PATH="$HOME/.composer/vendor/bin:$PATH"

Note: .zshrc exists in the home folder to append the line use following commands: