Skip to content

Instantly share code, notes, and snippets.

Not actively maintaining anything.

Daniel Espeset danielmendel

Not actively maintaining anything.
Block or report user

Report or block danielmendel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danielmendel / img-alt-reveal-marklet.js
Last active Dec 10, 2019
Replace images that have alt attributes with their text.
View img-alt-reveal-marklet.js
Array.from(document.querySelectorAll('img[alt]:not([alt=""])')).forEach($el => {
const $div = document.createElement('div');
$ = 'inline-block';
const {width, height} = $el.getBoundingClientRect();
$ = width;
$ = height;
$div.innerText = $el.getAttribute('alt');
$el.parentNode.replaceChild($div, $el);
danielmendel /
Last active May 12, 2018
Keybase proof

Keybase proof

I hereby claim:

  • I am danielmendel on github.
  • I am desp ( on keybase.
  • I have a public key ASBa6vwYa3n3Hp5k5gw0XkB8mki194rQyFiso26aB3rLUgo

To claim this, I am signing this object:

danielmendel / captureStartRender.js
Created Oct 16, 2013
Using requestAnimationFrame to approximate the browser's first paint time.
View captureStartRender.js
!function(namespace) {
// normalize requestAnimationFrame across user agents
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
// capture first paint
namespace.firstAnimationFrameFired = new Date().getTime();
View prefetching-example.js
var s = document.createElement('script');
s.src = preload[1];
s.type = "text/cache";
You can’t perform that action at this time.