Skip to content

Instantly share code, notes, and snippets.

View mwmaleks's full-sized avatar
🏠
Working from home

Alexey Nosov mwmaleks

🏠
Working from home
View GitHub Profile
(function(win){
'use strict';
var doc = win.document, simpleRe = /^(#?[\w-]+|\.[\w-.]+)$/, periodRe = /\./g, slice = [].slice;
win.query = function(selector, context){
context = context || doc;
if(simpleRe.test(selector)){
switch(selector.charAt(0)){
case '#':