Skip to content

Instantly share code, notes, and snippets.

@dciccale
dciccale / README.md
Last active March 27, 2016 18:19
Cross-browser eventHandler function done with 270 bytes of JavaScript

eventHandler

Cross-browser function to handle DOM events.

@dciccale
dciccale / README.md
Last active December 22, 2015 03:49
Binary search function done with 109 bytes of JavaScript

binarySearch

Tiny binary search done with 109 bytes of JavaScript.

@dciccale
dciccale / README.md
Last active December 17, 2015 00:29
Cross-browser removeEvent function done with 84 bytes of JavaScript

removeEvent

Cross-browser function to remove events from DOM elements.

@dciccale
dciccale / README.md
Last active December 16, 2015 06:49
Cross-browser addEvent function done with 81 bytes of JavaScript

addEvent

Cross-browser function to add events on DOM elements.

@dciccale
dciccale / README.md
Last active December 11, 2015 08:18
hasOwnProperty shim in 115 bytes (counting only the actual function)

hasOwnProperty shim

Cross-browser hasOwnProperty shim in 115 bytes of JavaScript.

.vimrc.json

A demo to see how it would be to have a .vimrc with json syntax.

@dciccale
dciccale / README.md
Last active December 9, 2015 17:49
requestAnimationFrame shim in 155 bytes (127 gzipped)

requestAnimationFrame shim

Cross-browser requestAnimationFrame in 155 bytes of JavaScript.

@dciccale
dciccale / README.md
Last active September 29, 2015 19:27
jQuery xxspubsub in 111 bytes gzipped inspired by @cowboy's Tiny Pub/Sub

jQuery XXSPubSub

jQuery pub/sub in 111 bytes gzipped inspired by @cowboy's Tiny Pub/Sub

@dciccale
dciccale / html5ie.js
Created December 23, 2011 14:50
HTML5 tag support for IE<9 in 222 bytes
for(var a="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),b=a.length;b--;)document.createElement(a[b])
@dciccale
dciccale / anotated.js
Created August 31, 2011 09:37
Detect if Flash Player is installed in your browser and get its version (180bytes)
function(a, b) {
try {
b = new ActiveXObject(a+b+'.'+a+b).GetVariable('$version')
} catch (e) {
b = navigator.plugins[a+' '+b];
b = b ? b.description : "";
}
return b.match(/\d+/)[0];