Skip to content

Instantly share code, notes, and snippets.

@adam-p
adam-p / Memory Leak Test Chrome Extension
Last active June 14, 2020 06:22
memory-leak-extension
Test extension to demonstrate possible memory leak in Chrome extension API.
Install it, open a bunch of tabs, open Chrome's task manager, let it run, watch memory usage increase.
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
@hotienvu
hotienvu / ngSize
Last active December 14, 2015 15:08
My custom directive to 2 way-bind the size attribute of <select>. The issue is open here https://github.com/angular/angular.js/issues/1619
myApp.directive('ngSize', function() {
return {
restrict:'A',
scope: {
ngSize: '='
},
link: function(scope, elem, attrs) {
scope.$watch("ngSize", function(newVal, oldVal) {
angular.element(elem).attr('size', newVal);
});
@eligrey
eligrey / html-domparser.js
Last active April 11, 2024 10:34
DOMParser HTML extension - Now a polyfill since HTML parsing was added to the DOMParser specification
/*
* DOMParser HTML extension
* 2019-11-13
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
@mrdoob
mrdoob / gist:845802
Created February 27, 2011 01:09
video to looped animated gif
ffmpeg -i out.ogv -s 160x128 -pix_fmt rgb24 -ss 62.6 -t 3 -r 5 -loop 0 -f gif out.gif
convert -loop 0 -layers Optimize out.gif outopt.gif