Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Neal jonathantneal

View GitHub Profile
View Accessible-Breadcrumbs-Markup.markdown

Accessible Breadcrumbs Markup

Screen Readers

On MacOS X Mountain Lion, VoiceOver 6 reads "Breadcrumbs with 3 items, navigation. Link, Home. Link, Library. Visited link, Data."

On Windows XP, Windows Eyes 7.5.4.1 reads "Two links. Link, Home. Link, Library. Visited Link, Data."

On Windows XP, NVDA 2012.3 reads "Navigation landmark. Link, Home. Link, Library. Visited Link, Data."

@jonathantneal
jonathantneal / README.md
Last active Aug 29, 2015
What’s in a language?
View README.md

What’s in a language?

TL;DR

English is the default language of the web.

If you serve multilingual content, you should know about the Content-Language header and the lang attribute.

The Content-Language header describes the language understood by your audience. It may contain multiple languages, but in practice, you should keep individual pages monolingual.

@jonathantneal
jonathantneal / longpoll.js
Created Mar 28, 2014
Simple longpoll functionality between JavaScript and PHP
View longpoll.js
function longpoll(src, onload, onerror) {
// create modified header
var ifModifiedSince;
// create request
function onrequest() {
var xhr = new XMLHttpRequest();
xhr.open('GET', src);
@jonathantneal
jonathantneal / README.xml
Created Apr 12, 2014
Match <script type="text/template"> variations
View README.xml
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)</string>
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)(?!.*type=(["']?)text/.*?(html|template)\3)</string>
@jonathantneal
jonathantneal / javascript.php
Created Apr 15, 2014
Javascript-like PHP syntax
View javascript.php
<?php
class jObject {
// Private
private $__ = null;
function __construct() {
call_user_func_array(array($this, '__init'), func_get_args());
}
@jonathantneal
jonathantneal / README.md
Last active Aug 29, 2015
Welcome to IE9
View README.md

Now that the bar has been set to Internet Explorer 9, I’m excited to bring some CSS to your attention.

Select things by their hierarchy: :first-child, :last-child, :only-child, :nth-child, :nth-last-child

Or by type: :first-of-type, :last-of-type, :only-of-type, :nth-of-type, :nth-last-of-type

Or not:

@jonathantneal
jonathantneal / README.md
Created Jun 11, 2014
Chapman University Homepage Update
View README.md

Chapman University Homepage Update

Overview

Create a fast, accessible, dynamic environment for visitors to learn more about Chapman University.

Big Goals

  • Minimize load time
  • Improve accessibility
View README.vm.html
#set($css_cache = {})
#macro (importCSS $path)
## if the path does not yet exist as a key in the cache
#if (!$css_cache.containsKey($path))
## load the path contents
#set($css = $_.locateFile($path))
## if the file exists, cache the contents using the path as the key
#if ($css)
@jonathantneal
jonathantneal / README.md
Created Jun 29, 2014
Fragmention edge cases
View README.md

Fragmention edge cases

#the+end // returns [ blockquote , em , p , blockquote ]
<blockquote>
	- the end -
@jonathantneal
jonathantneal / README-MF.html
Last active Aug 29, 2015
Marginalia Markup
View README-MF.html
<section>
<h2>Comments</h2>
<article class="h-entry">
<header>
<h3 class="p-name"><span>in reply to</span> <a class="u-in-reply-to" href="{{in_reply_to_link}}">{{in_reply_to_link}}</a></h3>
<p><span>by</span> <a class="p-author h-card" href="{{author_link}}"><img class="u-photo" src="{{author_image}}" alt=""> {{author}}</a></p>
</header>