Skip to content

Instantly share code, notes, and snippets.

@Fetz
Fetz / ie7querySelectorAll.js
Created December 3, 2015 10:51
How to add querySelectorAll to ie7
function querySelectorAll(el, query) {
if (el.querySelectorAll) return el.querySelectorAll(query);
var style = document.createStyleSheet();
var q = query.replace(/\[for\b/gi, '[htmlFor').split(',');
var results = [];
for (var i = q.length; i--;) {
style.addRule(q[i], 'k:v');
for (var j=el.all.length; j--;) {
el.all[j].currentStyle.k && results.push(el.all[j]);
@Fetz
Fetz / ex8.js
Last active October 15, 2016 16:43
rethinking asynchronous programming asynquence
$(document).ready(function(){
var rct = ASQ.react;
var $btn = $("#btn"),
$list = $("#list");
var clicks = rct.of();
$btn.click(function(evt) {
clicks.push('click');
});