Skip to content

Instantly share code, notes, and snippets.


Abhishek Dilliwal abhidilliwal

View GitHub Profile

Google closure compiler: Learnings from it.


  • Produces optimized results
  • Should be well tested as used by Google
  • Supports Splits.


  • Very obscure documentation, very few resources
  • Build system doesn't understand NPM module system completely, it does add support but you need to provide all the files which are needed to build the resource:
abhidilliwal / throttle.js
Created Oct 31, 2016
Throttle.js: rate limiter.
View throttle.js
* Throttle function
* Runs the `func` without any delay when called normally
* but if called many times it will rate limit.
function throttle (func, wait) {
var t;
var firstTime = true;
abhidilliwal / querySelectorPerf.js
Last active Feb 29, 2016
JavaScript Querying elements efficiently, fork from Zepto.js
View querySelectorPerf.js
// source/credits:
// usage query(document.body, '.cls .childrens')
function query(element, selector){
var found,
maybeID = selector[0] == '#',
maybeClass = !maybeID && selector[0] == '.',
nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked
isSimple = /^[\w-]*$/.test(nameOnly);
return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById

Copied from

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
View designer.html
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../topeka-elements/category-images.html">
<polymer-element name="my-element">
abhidilliwal / jsbin.OhuQuVaQ.css
Created Jan 16, 2014
just like scrollIntoView but with animation:
View jsbin.OhuQuVaQ.css
border: 1px solid green;
height: 300px;
overflow: auto;
padding: 20px;
background-color: green;
height: 50px;
abhidilliwal / jsbin.eqIbEp.css
Last active Dec 22, 2015
Credit card inout box
View jsbin.eqIbEp.css
border: 1px solid gray;
font-size: 24px;
padding: 5px;
outline: none;
width: 50%;
min-width: 300px;