Skip to content

Instantly share code, notes, and snippets.

View jonkpirateboy's full-sized avatar

Johan Jonk Stenström jonkpirateboy

View GitHub Profile
@jonkpirateboy
jonkpirateboy / youtube-auto-skip-ads.js
Last active March 20, 2026 10:56
Tampermonkey: YouTube Auto Skip Ads. Install Tampermonkey https://www.tampermonkey.net/ and add the script. Done.
// ==UserScript==
// @name YouTube Auto Skip Ads
// @description Skips ads on YouTube
// @namespace https://pirateboy.net
// @version 1.1
// @author Jonk
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@jonkpirateboy
jonkpirateboy / jquery-cookie-proxy.js
Created March 9, 2021 16:18
When you want to use js-cookie instead of jquery-cookie, but also use plugins requiring jquery-cookie. Or just lazy.
@jonkpirateboy
jonkpirateboy / Distraction Free YouTube
Last active November 28, 2016 07:34
Put the code in a browser button. If you click it when watching a YouTube-video, the video will open in a pop up. Disctraction free and perfect for watching videos while "working".
javascript:yturl=window.location.href;ytarr=yturl.split("?v=");ytqs=ytarr[1];ytqs=ytqs.replace("&","?");ytelem=document.getElementById("movie_player");yttime=Math.floor(ytelem.getCurrentTime());document.getElementsByTagName("video")[0].pause();if(ytqs.indexOf("?")>-1){ytqsstart="&"}else{ytqsstart="?"}window.open("https://www.youtube.com/embed/"+ytqs+ytqsstart+"autoplay=1&start="+yttime,ytqs,"width=400,height=300");void(0);
@jonkpirateboy
jonkpirateboy / chooseimagesize.php
Last active August 29, 2015 14:19
Make custom image sizes chooseable from admin
function fmd_image_sizes() {
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'bigger_thumbnail', 300, 300, true ); //will be visible in admin
add_image_size( 'carousel', 1300, 380, true ); //will not be visible in admin
}
}
add_action( 'init', 'fmd_image_sizes' );
function fmd_chooseable_image_sizes( $sizes ) {
return array_merge( $sizes, array(