This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MINIMALLY INVASIVE WCAG 2.1 COMPATIBLE MENU ADD-ON (as an afterthought). | |
* | |
* This example code provides the opportunity for a developer to make a menu that could possibly | |
* conform to WCAG 2.0 AA https://www.w3.org/WAI/standards-guidelines/wcag/new-in-21/ guidelines, | |
* if the developer follows and meets all realted WCAG 2.1 AA criteria. | |
* | |
* The script is intended to add an independent toggle button with ARIA and keyboard support without interfering with the current menu functionality. | |
* Compliance would likely require the toggle to be 44px. You can do that optionally in the Plugin's mm_toggle_styles options. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pdfminer3.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer3.pdfdevice import TagExtractor | |
from pdfminer3.pdfpage import PDFPage | |
from io import BytesIO | |
def convert_pdf(path, password=''): | |
rsrcmgr = PDFResourceManager() | |
retstr = BytesIO() | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, hashlib, optparse, requests | |
def get_remote_sha_sum(url): | |
'''put remote file in memory and create hash''' | |
response = requests.get(url) | |
try: | |
response.raise_for_status() | |
sha1 = hashlib.sha1() | |
response = response.content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import argparse | |
import io | |
import sys | |
def get_args(): | |
example_text = ''' | |
examples: | |
python3 ./logify.py --input-file='foo.json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Lighthouse custom config file for running A11y audits in Lighthouse. | |
* Includes all a11y audits and a few from Best Practices and SEO that are accessibility related. | |
* Organized into custom 'groups' | |
* | |
* Run: | |
lighthouse https://cats.com --config-path=/path/to/this/file/lh-config-a11y-extras.js --disable-device-emulation --output=json --output-path=catsaudit.json --chrome-flags="--headless --window-size=1300,600" | |
* | |
*/ | |
module.exports = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const labelCheckboxeChoices = Array.from(document.querySelectorAll('.q-checkbox')); | |
const labelRadioChoices = Array.from(document.querySelectorAll('.q-radio')); | |
var labelAllChoices = labelCheckboxeChoices.concat(labelRadioChoices); | |
labelAllChoices.forEach(function(e) { | |
if (e.innerText === '') { | |
e.remove(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
// NOTE: I suggest using this in addition to my Fork of the Flexslider library: | |
// https://github.com/jhc36-duke-edu/FlexSlider (This Fork fixes empty link problems that cannot be fixed through the api.) | |
$('.flexslider').flexslider({ | |
slideshow: false, | |
prevText: "Previous slide", | |
nextText: "Next slide", | |
animation: "fade", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interactive Element Affordance | |
*/ | |
'use strict'; | |
import ManualAudit from 'lighthouse-core' | |
const ManualAudit = require('../node_modules/lighthouse/lighthouse-core/audits/manual/manual-audit'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Config file for running just color-contrast. | |
*/ | |
'use strict'; | |
module.exports = { | |
extends: 'lighthouse:default', | |
settings: { | |
onlyAudits: ['color-contrast'], |
NewerOlder