Skip to content

Instantly share code, notes, and snippets.

@ckundo
ckundo / web_week1
Created November 1, 2012 22:18 — forked from sarahrothberg/web_week1
web_week1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
<html>
<head>
<title>ETZY!</title>
</head>
<body>
<center><b>Welcome to ETZY!</b><br> A super amazing and heretofore unheard of website for selling artwork online.
</center>
@ckundo
ckundo / coned.rb
Created November 4, 2012 17:25
stormpox.com - Coned class
class Coned
BOROS = ["Bronx" "Brooklyn", "Manhattan", "Queens", "Staten Island", "Westchester"]
def initialize
@response = HTTParty.get(coned_url_with_directory, :format => :json).parsed_response
@report = Report.new
end
def populate_worksheet
@report.update_worksheet(worksheet_data)
@ckundo
ckundo / Rakefile
Created November 4, 2012 17:26
stormpox.com - rake tasks
task :default do
Coned.new.populate_worksheet
end
<script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"> {"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=0AuBhi7TJm7ZqdEFKVk1ONXVDSTFWQTBraTFDR1VfMlE&transpose=0&headers=1&range=A1%3AG481&gid=0&pub=1","options":{"displayAnnotations":true,"titleTextStyle":{"fontSize":16},"vAxes":[{"useFormatFromData":true,"title":"Left vertical axis title","minValue":null,"viewWindowMode":"pretty","viewWindow":{"min":null,"max":null},"maxValue":null},{"useFormatFromData":true,"minValue":null,"viewWindowMode":"pretty","viewWindow":{"min":null,"max":null},"maxValue":null}],"booleanRole":"certainty","title":"Chart title","animation":{"duration":500},"displayZoomButtons":false,"wmode":"opaque","hAxis":{"useFormatFromData":true,"title":"Horizontal axis title","minValue":null,"viewWindowMode":"pretty","viewWindow":{"min":null,"max":null},"maxValue":null},"width":910,"height":612},"state":{},"view":{},"chartType":"AnnotatedTimeLine","chartName":"Chart 1"} </script>
@ckundo
ckundo / narcisscript.js
Created December 16, 2012 23:51
Facebook Narcisscript: changes all Facebook images into YOU!
var imgs = document.getElementsByClassName('img');
var jewelz = document.getElementsByClassName('jewelCount');
var speekz = ['1337', '404', '9001'];
for(var i = 0; i < imgs.length; i++) {
imgs[i].src = document.getElementsByClassName('fbxWelcomeBoxImg')[0].src
}
for(var i = 0; i < jewelz.length; i++) {
var jewl = jewelz[i];
@ckundo
ckundo / corn
Created April 3, 2013 15:29 — forked from toothrot/corn
$ corn
.-'"`/\
// /' /\`\
('//.-'/`-.;
\ \ / /-.
__.__.___..__._.___.\\ \\----,_
.:{@&#,&#@&,@&#&&,#&@#&@&\\` \-. .-'-.
.:{@#@,#@&#,@#&&#,@&#&@&,&@#&&\\, -._,"- \
.{#@#&@#@#&#&@&#@#@&#,@#@#&@&&#@#\ \// = \`=\__
`{#@,@#&@&,@&#@,#@&#@#&@#&@,&#@,#/\/ =`-. -_=__
@ckundo
ckundo / gist:5342698
Last active December 15, 2015 23:49
draft for article on a11yproject.com

Short answer: Use skip nav links in conjunction with coherent heading outline and ARIA Landmarks, and be aware of browser support.

It can be frustrating and fatiguing for folks with limited mobility to have to have to repeatedly tab through navigation links to get to the main content of a page. People who use screen readers face similar frustration with repetitive content on poorly structured pages. In order to address this issue, WCAG 2.0 has specified a guideline for bypassing blocks of content that are repeated across multiple pages.

A classic approach to fulfilling this requirement has been to include a [skip navigation link][1] at the beginning of the page, that changes focus to the first element after the repeated content.

<body>
  <a href="#main">Skip to main content</a>
  <nav role='navigation'>
@ckundo
ckundo / gist:5347552
Created April 9, 2013 17:18
This js/jquery snippet will give focus to the first link in the main content area as defined by role='main'. This is a hack on top of the conventional 'skip navigation' link hack, that in many browsers does not change keyboard focus. It enhances the aria landmark role=main, which is widely supported by screen readers. Two birds with one stone.
// <a href="#" id="skip-nav">Skip Navigation</a>
// <div role='main'>
// <a href="#">This receives focus on clicking skip nav</a>
// </div>
$('#skip-nav').click(function(e) { $("[role='main'] a:first").focus(); e.preventDefault(); })
(function($) {
// cache some values
var cache = {
idx_expanded : -1, // the index of the current expanded slice
sliceH : 0, // the default slice's height
current : 0, // controls the current slider position
totalSlices : 0 // total number of slices
},
aux = {
@ckundo
ckundo / skip_nav.html
Last active December 17, 2015 11:09
Skip Navigation Link Example
<body>
<a href="#main">Skip to main content</a>
<nav role='navigation'>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/blog">Blog</a></li>
</ul>
</nav>
<div id="main" role="main">