Skip to content

Instantly share code, notes, and snippets.

View jjmss's full-sized avatar

Jon Martin Stuberg jjmss

View GitHub Profile
@jjmss
jjmss / styled-checkboxes.css
Created September 1, 2022 08:08
Styles checkboces
[type="checkbox"]:not(:checked),[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked) + label,[type="checkbox"]:checked + label {
position: relative;
padding-left: 2.5em !important;
cursor: pointer;
}
@jjmss
jjmss / wpe-site-redirect-bookmark.js
Last active April 20, 2022 11:17
When added to your bookmarks, you can use this to open the wordpress site from the wpengine install
javascript:(function(){"my.wpengine.com"===window.location.host&&(x=`//${window.location.pathname.split("/")[2]}.wpengine.com/`,window.open(x)||(location.href=x))})()
@jjmss
jjmss / alt-tag.js
Created March 2, 2022 12:58
Bookmark to check what images that are missing alt-tags (wp)
javascript:(function(){var image_log = ''; var images = document.querySelectorAll("img[alt='']");for(let i = 0; i < images.length ; i++) {images[i].style.background = "#f75959";images[i].style.padding = "20px";image_log += (images[i].src + '\n')}console.log(image_log)})()
@jjmss
jjmss / external-links.js
Created March 2, 2022 12:57
Add the script to bookmark to detect external links that doesn't open in a new window
@jjmss
jjmss / slick-animation-transition-fix.js
Last active July 13, 2021 07:34
Slick slider last/first slide fix for slider with animated transitions
jQuery(($) => {
const $slider = $('#slider');
$slider.slick({
centerMode: true,
slidesToShow: 3,
});
$slider.on('beforeChange', (event, slick, current, next) => {
@jjmss
jjmss / wp-admin-bookmark.js
Created June 25, 2021 07:59
When added to your bookmarks, you can use this to get to the login page of wordpress
javascript:(function(){x=window.location.origin+'/wp-login.php?redirect_to='+encodeURIComponent(window.location.href)+'&action=sign-out';if(!window.open(x))location.href=x})()