Skip to content

Instantly share code, notes, and snippets.

@dsiddy
Last active December 30, 2015 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsiddy/748c72ee1aefc39d2c95 to your computer and use it in GitHub Desktop.
Save dsiddy/748c72ee1aefc39d2c95 to your computer and use it in GitHub Desktop.
console one-liners
// block all tracking domains detected by Privacy Badger
jQuery('#blockedResources .clickerContainer input[id^=block]').each(function(index, element) { $(element).click() });
// Republican presidential debate speaker counts
// @see http://www.nytimes.com/2015/12/16/us/politics/transcript-main-republican-presidential-debate.html
console.log(['PAUL', 'CHRISTIE', 'BUSH', 'CRUZ', 'TRUMP', 'CARSON', 'RUBIO', 'FIORINA', 'KASICH'].map(function(candidate) { return document.querySelector('#story-body').textContent.match(new RegExp(candidate, 'g')).length }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment