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
/** | |
* 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
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
// 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 |
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
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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
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 to generate random strings | |
* @param int $length number of characters in the generated string | |
* @return string a new string is created with random characters of the desired length | |
*/ | |
function RandomString($length = 32) { | |
$randstr; | |
srand((double) microtime(TRUE) * 1000000); | |
//our array add all letters and numbers if you wish | |
$chars = array( |
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
<!--// Fixed for accessibility by Karl Groves 22-Oct 2013. Original Gist @ https://gist.github.com/briancollins/6365455 //--> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Getting Started Form</title> | |
<!-- The required Stripe lib --> | |
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> |
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') |
NewerOlder