$ sw_vers
cd /Library/Logs/DiagnosticReports
- `grep -ir ".panic" *
- Note: can also use Console app → System Reports
log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
I was carrying out an accessibility evaluation of a site and, by chance, none of the images loaded. I noticed that the images' alt
attributes but they weren't showing.
It turned out that the developer had put font-size:0
on the containing <figure>
element and then specified a new font-size on the <figcaption>
element. I don't know why either.
As current accessibility testing tools don't currently test for this (which isn't suprising as it is something of an edge case), I wrote a bookmarklet to break all the images created with an element so that their alt text (if any) would show.
The bookmarklet works by replacing each image's URL with a new one.
Sometimes you need text, rather than voice, output from screen readers. Why? It's really useful for bug reports ("this disclosure icon is announced as 'black dash triangle dash filled dash x2 underscore final dot png' and needs alt text"). Luckily, getting this text is easy to do.
In VoiceOver you press Option + Control + Shift + C to have the last item that was announced copied to the clipboard. Bonus feature: pressing Option + Control + Shift + Z to save the last phrase to the desktop as an audio file.
A three-finger quadruple tap copies the last announcement to the clipboard.
1. Split each word onto it's on line (use text editor until bash command can be found) | |
2. Strip out things like speech marks, brackets, full stops, commas, slashes, dashes, etc | |
3. `awk '{print tolower($0)}' filename | sort > outputfilename` |
# Useful Git commands | |
## Config Options | |
git config --global user.name "First Last" | |
git config --global user.email "emailaddress" | |
git config user.email "emailaddress" : sets email address for a repo instead of globally | |
git config user.email : shows which email address it is using in the repo you're currently in | |
git config --global core.editor emacs : should you want to specifiy an editor for interactive commands See [associating text editors with Git](https://help.github.com/articles/associating-text-editors-with-git/) for more options | |
git config --global merge.tool opendiff : specify a merge tool (OSX only) |
function sizeSelects(){ | |
var fs = window.getComputedStyle(document.querySelector("body"),null).getPropertyValue("font-size").slice(0,-2); | |
var selects = document.querySelectorAll("select"); | |
for (var select = 0; select < selects.length; select++){ | |
var opts = selects[select].querySelectorAll("option"); | |
var len = 0; | |
var longest = 0; |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script>window.jQuery || document.write("<script src='URL'>\x3C/script>")</script> |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML download attribute</title> | |
</head> | |
<body> | |
<ul> | |
<li><a href="downloadable-file.txt">View your invoice</a></li> | |
<li class="download"><a href="downloadable-file.txt">Right-click and select Save to download your invoice</a></li> |
$eminpx:14; | |
@function pxtoem($target, $context:$eminpx){ | |
@return #{$target/$context}em; | |
} | |
@function emtopx($target, $context:$eminpx){ | |
@return #{$target*$context}px; | |
} |