Skip to content

Instantly share code, notes, and snippets.

@mikkotikkanen
Last active November 23, 2020 14:43
Show Gist options
  • Save mikkotikkanen/ee3bfd4e2f36ce86f9a954991c5fa3b6 to your computer and use it in GitHub Desktop.
Save mikkotikkanen/ee3bfd4e2f36ce86f9a954991c5fa3b6 to your computer and use it in GitHub Desktop.
/**
* As AWS re:Invent 2020 agenda viewer doesn't (yet, at least) provide a way to hide non-english
* sessions, here is a hack to just hide those sessions from the list
*
* To use, just copy-paste this to your developer console in the browser
*
* Agenda is available at: https://virtual.awsevents.com/agenda
*
* Also, here is a bookmarklet URL: javascript:var%20id%3D%22ee3bfd4e2f36ce86f9a954991c5fa3b6%22%2Cfile%3D%22reinvent2020agenda-hidenonenglish.js%22%2Cuser%3D%22mikkotikkanen%22%2Cxhr%3Dnew%20XMLHttpRequest%3Bxhr.overrideMimeType(%22application%2Fjson%22)%3Bxhr.open(%22GET%22%2C%22https%3A%2F%2Fgist.githubusercontent.com%2F%22%2Buser%2B%22%2F%22%2Bid%2B%22%2Fraw%2F%22%2Bfile)%3Bxhr.onreadystatechange%3Dfunction()%7Bif(4%3D%3D%3Dxhr.readyState)if(200%3D%3D%3Dxhr.status)console.log(%22Successfully%20loaded%20gist%3A%22%2C%7Bid%3Aid%2Cfile%3Afile%2Cuser%3Auser%2Cresponse%3Axhr.responseText%7D)%2C(0%2Ceval)(xhr.responseText)%3Belse%7Bvar%20a%3D%22GitHub%20Gist%20file%20did%20not%20load%20successfully%20and%20instead%20returned%20a%20status%20code%20of%20%22%2Bxhr.status%2B%22.%22%3Bconsole.error(a%2C%7Bid%3Aid%2Cfile%3Afile%2Cuser%3Auser%7D)%3Balert(a)%7D%7D%3Bxhr.send(null)%3Bvoid+0
*/
const debounce = (e,t) => {let n;return function(){clearTimeout(n),n=setTimeout(e,t)}}
const hideTag = (tag) => $(`.tag:contains(${tag})`).parents('.event-list-item.event-list-single-item').hide();
const hideNonEnglish = () => ['Spanish', 'Portuguese', 'Italian', 'French', 'Japanese', 'Chinese', 'Korean'].forEach(hideTag);
$('.event-list').bind('DOMSubtreeModified', debounce(hideNonEnglish, 100));
hideNonEnglish();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment