Skip to content

Instantly share code, notes, and snippets.

// run this in developer console
// extract
var date = document.querySelector('.Select-value-label').innerText
var rows = document.querySelectorAll('._6RQIT');
var dataRows = [];
for(var i = 0; i < rows.length; i++){
var row = rows[i];
var tableName = row.querySelector('._2EwHU').innerText;
var mar = row.querySelector('._1LLtK').innerText.replaceAll(',', '');
@tommyh
tommyh / 01_Readme.md
Last active February 4, 2018 12:48
Find overriden native objects

The goal of this code is to find javascript native objects which have been overriden (by various script tags).

Usage

  1. Open Chrome Devtools
  2. Run the "create clean iframe" code
  3. Switch to the "foo" console js context
  4. Run the "find non-native functions" code
  5. It will output any matches it finds

Next Steps

@tommyh
tommyh / gist:c8aacc6bf303bd2243eeeca8cba67ca3
Last active August 17, 2016 22:32
LKQD: Ad Parameters Debugging
<AdParameters>eNrFWP9v2jgU/1+i1T9BSBw7BKRo4gRdueuXE9CdTtMUmcSA1yTObIeWVfzv9xyKdv2yqduYQCWOn/2+f95zzb2jheFO/97RhXD6vud5LftaVE6/rPO85WSyYKJ0+o7h2rRZbWBuhCzbTBmxYKnRrg5cVrAvsmS32k1l4YCISmRWXNiLWs6aK7EQacPm9D/cOyUrQKdzuwLdstKwv1Y5EFbGVP1OR7uFKjRXa26ldXCnR0lIaYeVLN8YkWr3k36rRUx6xKOIiRiHXZSqGKXzOPJCQoJe1EWZiF9vMsoKYPdja8FJMDjBp/BnZG3an5n7ejHAVOXMtLEXRZZzZYocpRhEB/Alccb1jZEVSml8PUVpGBcsPcGe1PC4Q7X1pBf4NIgiPwhwQAPSDZERceB3A0J7JKDdEFOMvYAg5cdI4RhWXEy6rt8L3SBCChRlJt5FzCchCULfI8Df83zsbD+2nCYzELGWw8u1fQ8s7Y7nc6b51yQYN7/5nLklNx3zlq/jN/ej96PLWTIebhGIaGKuYdwlweY7btKNKktFlSUg83UHKIsDm6FuENDIx7Tbox5aSAVBjT3IFohEstnvoaqeG7Y0m4rHa6bNumIiQ9ae51TFy4wrMG8yuhyOJlvEKhPbZEE4i+rFyJlcxT7Sa6Vjz/Ux0mptre9iN/Bd36euTwIkRfU0tpbhzf370WQ6vrrcgnM5TGfji1Eyu5oNzreIM2vI+6vz64vRFt2KzKxg/s94ODvbohUXy5WB+dlo/O5sBlFcSW3nf58P/h1NkrOr6exyYBn39MG7UTK8uhiML61Xla2aGIlswWIAPUR3XpdZzu1b3sQ8lymAbzfKctkAuhBZYvGa5jwBaG64snjkQUi8yKLS1mohnb4t+1waDdBoOWkueGmmIuNDPq+XTn/Bcs0BJmzJH1Xqj1dI51l9gAVrmde2I/jWCgvJBjKgDwwWpTCg0Ap3tg9I1U0X4WswcmzbDNlD+Fo1a86b+z8G01FyPTnfOh
@tommyh
tommyh / player_sdk.md
Last active April 26, 2017 22:43
Player SDK

Get all players

var allPlayers = TOUT.players.getAll();

Get all players with a specific type

var topArticlePlayers = TOUT.players.byProductName(TOUT.PRODUCTS.TOP_ARTICLE);
var midArticlePlayers = TOUT.players.byProductName(TOUT.PRODUCTS.MID_ARTICLE);
@tommyh
tommyh / gist:db777fddbdc5040b8dc3
Last active December 22, 2015 01:30
onGlobalDefined
var onGlobalDefined = function(func, varName){
if(typeof window[varName] !== "undefined"){
console.log("running");
func();
} else {
console.log("waiting");
setTimeout(function(){
onGlobalDefined(func, varName);
}, 10);
}
var fakeWindow = {};
for(var key in window) {
if(key !== "location"){
fakeWindow[key] = window[key];
}
}
var fakeLocation = {};
<!DOCTYPE>
<html>
<body>
<h1>Gardner Meerkat Bookmarklet</h1>
<a href="javascript:(function()%7B(function()%7Bvar%20css%20%3D%20'iframe%23mkEmbedPlayer-gardner%20%7B%20width%3A%20465px%20!important%3B%20height%3A%20465px%20!important%3B%20%7D'%2Chead%20%3D%20document.head%20%7C%7C%20document.getElementsByTagName('head')%5B0%5D%2Cstyle%20%3D%20document.createElement('style')%3Bstyle.type%20%3D%20'text%2Fcss'%3Bif%20(style.styleSheet)%7Bstyle.styleSheet.cssText%20%3D%20css%3B%7D%20else%20%7Bstyle.appendChild(document.createTextNode(css))%3B%7Dhead.appendChild(style)%3Bvar%20wrapper%20%3D%20document.createElement(%22div%22)%3Bwrapper.id%20%3D%20%22meerkat-wrapper%22%3Bwrapper.style.position%20%3D%20%22fixed%22%3Bwrapper.style.bottom%20%3D%20%220%22%3Bwrapper.style.right%20%3D%20%220%22%3Bvar%20script%20%3D%20document.createElement(%22script%22)%3Bscript.src%20%3D%20%22http%3A%2F%2Fmeerkatapp.co%2Fwidgets%2Fembed.js%22%3Bscript.className%20%3D%20%22mkEmbedPlayer%22%3Bscript.setAttribute(%22data-mute%22%
<h1>IAS: Pixel Tracking Debuger</h1>
<p>This page provides a bookmarklet to help debug the IAS tracking pixels.</p>
<h3>Usage</h3>
<ol>
<li>Install the bookmarklet by dragging the link below into your bookmarks bar</li>
<li>Go to a page which has a video player on it where IAS verification is in use</li>
<li>Click the bookmarklet</li>
<li>You should see 9 red squares appear - these are the IAS tracking pixels</li>
<li>You might see a the video player get a white halo around it. This will happen when the bookmarklet finds a script tag with the source of http://pixel.adsafeprotected.com/jload, and then it puts a border around the scripts parentNode.</li>
@tommyh
tommyh / README.md
Last active November 5, 2015 22:30
Tout: Wordpress Fix

Tout: Wordpress fix

Some wordpress themes have css styles which modify the height attribute for video players, resulting in a player element which has a small height and is broken. These css styles will fix those issues.

/*
Copyright (c) 2008-2015 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: