This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDomPath(el) { | |
var stack = []; | |
while ( el.parentNode != null ) { | |
console.log(el.nodeName); | |
var sibCount = 0; | |
var sibIndex = 0; | |
for ( var i = 0; i < el.parentNode.childNodes.length; i++ ) { | |
var sib = el.parentNode.childNodes[i]; | |
if ( sib.nodeName == el.nodeName ) { | |
if ( sib === el ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRemoteMimeType($url) { | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_exec($ch); | |
# get the content type | |
return curl_getinfo($ch, CURLINFO_CONTENT_TYPE); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* cleans up strings so they can be used in URLS | |
* @author "Borek" - attributed to a post located at: | |
* http://drupal.org/node/63924 | |
* @param string $string the string we're cleaning | |
* @return string the input string, ready to go | |
*/ | |
function pathauto_cleanstring($string) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// focusable is a small jQuery extension to add a :focusable selector. Credit to ajpiano on the jQuery forums. | |
// | |
$.extend($.expr[':'], { | |
focusable: function(element) { | |
var nodeName = element.nodeName.toLowerCase(); | |
var tabIndex = $(element).attr('tabindex'); | |
// the element and all of its ancestors must be visible | |
if (($(element)[(nodeName == 'area' ? 'parents' : 'closest')](':hidden').length) == true) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var%20ua=navigator.userAgent.toLowerCase(),ie=ua.indexOf(%22msie%22)!=-1?ua.substr(ie+5,1):0,outlineProp=ie%3C8?%22border%22:%22outline%22,activeItem;function%20styleFocus(e){if(activeItem){activeItem.style[outlineProp]=%22%22;}activeItem=e.target||e.srcElement;if(activeItem){activeItem.style[outlineProp]=%22solid%202px%20red%22;}}if(document.addEventListener){document.addEventListener(%22focus%22,styleFocus,true);}else{document.attachEvent(%22onfocusin%22,styleFocus);}}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var html=document.documentElement.innerHTML;var loaded=0;var iframe=document.createElement('iframe');iframe.name='bookmarklet-'+Math.floor((Math.random()*10000)+1);iframe.style.display='none';iframe.onload=function(){if(++loaded==1){return}document.body.removeChild(iframe)};var form=document.createElement('form');form.method="POST";form.action="https://tenon.io/api/";form.target=iframe.name;var hidden=document.createElement('input');hidden.type='hidden';hidden.name='key';hidden.value='ADD_YOUR_API_KEY_HERE';var store=document.createElement('input');store.type='hidden';store.name='store';store.value='1';var textarea=document.createElement('textarea');textarea.name='src';textarea.value=html;form.appendChild(hidden);form.appendChild(store);form.appendChild(textarea);iframe.appendChild(form);document.body.appendChild(iframe);form.submit()})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
var html = document.documentElement.innerHTML; | |
/** | |
* the iframe's onload event is triggered twice: once when appending it to the document, | |
* and once when the form finishes submitting and the new URL is loaded | |
*/ | |
var loaded = 0; | |
var iframe = document.createElement('iframe'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('*').removeClass(); | |
$('*').removeAttr('style'); | |
$('link[rel="stylesheet"]').remove(); | |
$('img').each(function () { | |
$(this).replaceWith( | |
$(this).attr('alt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* UNLIKE | |
* Navigate to your "likes" | |
* Open devtools & go to Console | |
* Paste this snippet in & hit Enter | |
*/ | |
setInterval(() => { | |
for (const d of document.querySelectorAll('div[data-testid="unlike"]')) { | |
d.click() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Obvs you have you `npm install axios` | |
const axios = require('axios'); | |
const fs = require('fs'); | |
const env = 'https://tenon.io/api/v2/'; // NOTE: if you have a private instance of Tenon, you'd change the domain part of this value | |
const username = 'YOUR_EMAIL_GOES_HERE'; | |
const password = 'PASSWORD_GOES_HERE'; | |
const projectID = 'PROJECTID_GOES_HERE'; | |
const sourceFile = './file.html'; // replace with the path to the file you want to send to Tenon |
OlderNewer