My favorite sorting algorithm.
A Pen by Gerald Fullam on CodePen.
content = content | |
// Replace hypen, if between number, with en-dash | |
.replace(/(\d+)-(\d+)/ig, '$1–$2') | |
// Replace hypen, if between spaces, with em-dash | |
.replace(/( +)-+( +)/ig, '$1—$2') | |
// Replace smart double quotes with straight double quotes | |
.replace(/“|”|„|‟|″|‶/ig, '"') | |
// Source: http://stackoverflow.com/a/13455920/2502532 | |
// ------------------------------------------------------------------- | |
// Add prototype for 'window.location.query([source])' which contain an object | |
// of querystring keys and their values | |
// ------------------------------------------------------------------- | |
if(!window.location.query) { | |
window.location.query = function(source){ | |
var map = {}; | |
source = source || this.search; |
/* Based on: http://stackoverflow.com/a/901144/2502532 */ | |
var getParam = function(key) { | |
key = key.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | |
var val = window.location.search.match(new RegExp('[\\?&]' + key + '=([^&#]*)')); | |
return val === null ? '' : decodeURIComponent(val[1].replace(/\+/g, ' ')); | |
}; | |
console.log(getParam('foo')); |
My favorite sorting algorithm.
A Pen by Gerald Fullam on CodePen.
<div class="button-list namespace"> | |
<h2>$('selector').tooltip()</h2> | |
<ul> | |
<li> | |
<span>Lorem Ipsum Dolar Sit</span> | |
<button type="button">+ | |
<span class="tooltip" role="tooltip">Hello World again and again and again and again.</span> | |
</button> | |
</li> | |
<li> |