Skip to content

Instantly share code, notes, and snippets.

View potch's full-sized avatar

Potch potch

View GitHub Profile
@davatron5000
davatron5000 / southwestSort.js
Last active August 29, 2015 14:26
southwestSort
var letters = ["q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m"];
function southwestSort( arr ) {
var a = arr.slice( 0, Math.floor(arr.length / 3) );
var b = arr.slice( Math.floor(arr.length / 3), Math.floor(arr.length / 3)*2 );
var c = arr.slice( Math.floor(arr.length / 3)*2, arr.length );
return a.sort().concat(b.sort()).concat(c.sort());
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
</head>
<body>
<!-- You MUST use JavaScript to inject a string into a role=alert container that was already present in the DOM on page load for it to actually speak out loud to the screen reader user! -->
@jlongster
jlongster / gist:3876506
Created October 12, 2012 00:02
sweet.js macros
macro def {
case $name:ident $params $body => {
function $name $params $body
}
case $params $body => {
function $params $body
}
}