Skip to content

Instantly share code, notes, and snippets.

View bjankord's full-sized avatar
🎵
Chillin'

Brett Jankord bjankord

🎵
Chillin'
View GitHub Profile

test blockqoute

Anyone know of a javascript date picker that is:

  • WCAG 2.0 compliant
  • Has Keyboard support

Creating a new element named picture or pic that mirrors the img element would allow for an easier responsive image element to polyfill.

When polyfilling srcN paired with the image element, legacy browsers which don't support srcN would download the image from the src attr and the matching srcN attr. This would result in dual downloads in legacy browser which need the srcN polyfill. These "legacy browsers" are every browser today.

A few ways around this would be to leave the img src attr empty. Or remove it all togher.

From Riloadr docs, Túbal Martín has some concerning notes about leaving the src attr empty on img elements.

Warning!: >Do not set an empty string for the value of src src="".

@bjankord
bjankord / grid.css
Created July 31, 2013 13:28
Minimal Grid
.grid {
overflow: hidden;
margin-left: -1.4rem;
}
.grid-col {
float: left;
padding-left: 1.4rem;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@bjankord
bjankord / gist:5526074
Created May 6, 2013 16:02
Mapping $ to document.querySelector
<h1>From: http://flippinawesome.org/2013/05/06/5-things-you-should-stop-doing-with-jquery/</h1>
<div class="container">
<ul>
<li id="pink">Pink</li>
<li id="salmon">Salmon</li>
<li id="blue">Blue</li>
<li id="green">Green</li>
<li id="red">Red</li>
</ul>
</div>
ready: (function() {
...
//Mozilla, Opera, and Webkit
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", idempotent_fn, false);
...
}
//IE event model
@bjankord
bjankord / gist:5188081
Created March 18, 2013 15:41
Enhanced JS checks
//Way to differieniate between enhanced and base versions from http://www.zachleat.com/toolordie/set2/slide4.html
// IE8+, BB 5+
"querySelectorAll" in document
// IE7+ (jQuery Mobile 1.0)
$.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7;
// IE9+, BB 7+