This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Later( fn ){ | |
// 0: pending; 1: resolved; 2: cancelled; | |
var status = 0; | |
var resolve = setTimeout( function resolve(){ | |
fn(); | |
status = 1; | |
}, 0); | |
return { | |
cancel : function cancel(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ie { | |
display: none; | |
} | |
.ie9 { | |
display: block\9; | |
display: none/; | |
} | |
.ie8 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void function semanticContentScope(context, jQuery){ | |
var $ = context.jQuery || jQuery || false; | |
if(!$){ | |
return false; | |
} | |
// Strips elements of duplicate, leading and trailing whitespace and removes empty non-functional elements recursively | |
function semanticContent(markup){ | |
// Conversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.reverse = function(fn){ | |
return this.each(function(el, i){ | |
var $all = $('<x>').append(el).find('*'); | |
fn.call([].reverse.call($all)); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void function(){[].forEach.call(document.querySelectorAll('.read_more'),function(a){var x=new XMLHttpRequest();x.onload=function(){a.outerHTML=this.responseText.split('<!-- more -->')[1].split('<div class="footer')[0]};x.open('get',a.href,true);x.send()})}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void function blockRest($){ | |
function getRest(target){ | |
var andParent = target.add(target.parents()); | |
return andParent.siblings(); | |
} | |
$.fn.blockRest = function(){ | |
getRest(this).block(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.FFS = function FilterFindSolution(){ | |
var a = ['filter','find']; | |
var p = [].slice.call(arguments); | |
var y = $(); | |
this.each(function(){ | |
var e = $(this); | |
var i = -1; | |
while(i++ < 1) y = y.add(e[a[i]].apply(e, p)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countries = uncomment(function(){ | |
/* | |
Afghanistan | |
Albania | |
Algeria | |
Andorra | |
Angola | |
Antigua and Barbuda | |
Argentina | |
Armenia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Provides a jQuery 'target' event that fires in all conditions that would | |
* result in an element becoming the target of the URI fragment identifier or | |
* hash as it is often called. It aims to provide a behavioural hook to emulate | |
* CSS3's :target selector [1] (more here [2] and here [3]: good demos include | |
* this proof of concept [4] and Wikipedia's styling of targeted footnotes and | |
* citations [5]). | |
* | |
* [1] https://developer.mozilla.org/en-US/docs/Web/CSS/:target | |
* [2] http://css-tricks.com/on-target/ | |
* [3] http://blog.teamtreehouse.com/stay-on-target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function contains(string, substring){ | |
return string.indexOf(substring) > -1; | |
} |