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
function cleanupduplicates($array){ | |
$n = 0; | |
$crap = array_values(array_unique($array)); | |
$cc = count($crap); | |
for ($i = 0; $i < $cc; $i++) { | |
if ($crap[$i] != ''){ | |
$img[$n] = $crap[$i]; | |
$n++; | |
} | |
} |
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
/** | |
* returns the difference between two times | |
* @param string $start the starting time for comparison | |
* @param string $end the ending time for comparison | |
* @return array an array is populated with the time difference | |
*/ | |
function timediff($start, $end) { | |
$timediff = $end - $start; | |
$days = intval($timediff / 86400); | |
$remain = $timediff % 86400; |
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
/** | |
* compares two arrays to check if they're identical | |
* @param array $op1 the first array | |
* @param array $op2 the second array | |
* @return bool | |
*/ | |
function arrayIdentical($op1, $op2) { | |
if (count($op1) < count($op2)) { | |
return FALSE; | |
// $op1 < $op2 |
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
<?php | |
// If your Wordpress blog isn't in the document root, | |
// you may have to change the path to wherever the | |
// Wordpress root directory | |
require($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php'); | |
// if the user isn't logged in, this will redirect them | |
// to the login page. On successful login it will redirect | |
// them to the page this code is currently in. | |
if(FALSE === is_user_logged_in()){ |
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() { | |
var script = document.createElement('script'); | |
script.async = 1; | |
script.src = '<url to script>'; | |
document.getElementsByTagName('body')[0].appendChild(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
function isBlank(str){ | |
return str.replace(/\W/gi, '') == ''; | |
} |
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; |
OlderNewer