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 | |
/** | |
* Title: Book Review | |
* Slug: twentytwentythree/book-review | |
* Categories: query | |
* Keywords: post meta | |
* Block Types: core/post-content | |
* Post Types: book | |
*/ | |
?> |
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
import {store as blockEditorStore } from '@wordpress/block-editor'; | |
import { useSelect } from "@wordpress/data"; | |
// Inside component | |
const {sizes} = useSelect((select) => { | |
const { getSettings } = select(blockEditorStore); | |
const settings = getSettings(); | |
const sizes = settings?.imageEditing?.imageSizes; |
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
#!/bin/bash | |
git rebase -i $(git merge-base HEAD master) |
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
// ==UserScript== | |
// @name Recursively expand Github PR comments | |
// @namespace http://aheadcreative.co.uk/ | |
// @version 1.0 | |
// @description Automatically expands all those pesky folded Github PR comments. | |
// @author Dave Smith (@getdave). Please contact for questions and feedback | |
// @match https://github.com/*/*/pull/* | |
// @copyright 2020, Ahead Creative | |
// @updateURL https://gist.githubusercontent.com/getdave/9b9087055decf6f6cb7bfada08fcd3d1/raw/ | |
// ==/UserScript== |
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()%7Bfunction%20githubLoadAllPRComments()%20%7B%0A%0A%20%20%20%20function%20recursiveExpandLoadMore()%20%7B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20Remove%20all%20existing%20timers%0A%20%20%20%20%20%20%20%20if(theTimeout)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20clearTimeout(theTimeout)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20const%20disabledLoadBtns%20%3D%20document.querySelector('.ajax-pagination-btn%5Bdisabled%5D')%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20any%20buttons%20are%20already%20in%20the%20loading%20state%20then%20requeue%0A%20%20%20%20%20%20%20%20if(disabledLoadBtns)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20theTimeout%20%3D%20setTimeout(recursiveExpandLoadMore%2C%201000)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20const%20loadBtn%20%3D%20document.querySelector('.ajax-pagination-btn%3Anot(%5Bdisabled%5D)')%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20there%20are%20no%20more%20load%2 |
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
<!-- wp:group {"paddingSize":"default","marginSize":"default"} --> | |
<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:heading --> | |
<h2>paddingDefault/marginDefault</h2> | |
<!-- /wp:heading --> | |
<!-- wp:paragraph --> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | |
<!-- /wp:paragraph --></div></div> | |
<!-- /wp:group --> |
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() { | |
let _takingTooLongTimeout; | |
const alarmSound = new Audio("https://archive.org/download/alarm_162/alarm.ogg"); | |
const startVideo = () => { | |
document.querySelector("video").play(); | |
}; | |
const stopVideo = () => { | |
document.querySelector("video").pause(); |
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()%7B(async%20function()%20%7Bconst%20video%20%3D%20document.querySelector('video')%3Bif(!video)%20%7Balert(%22No%20video%20element%20found%20on%20page%22)%3B%7Dif%20(video%20!%3D%3D%20document.pictureInPictureElement)%20%7Bawait%20video.requestPictureInPicture()%3B%7D%20else%20%7Bawait%20document.exitPictureInPicture()%3B%7D%7D())%7D)() |
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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^source-domain.com [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.source-domain.com [NC] | |
RewriteRule ^(.*)$ https://target-domain.com/$1?source=sourcedomain [L,R=302,NC] |
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
var myImage = 'someimage.jpg'; | |
fetch(myImage) | |
.then(response => response.blob()) //To extract the image body content from the response, we use the blob() method | |
.then(myBlob => { | |
// An objectURL is then created from the extracted Blob, which is then inserted into the img. | |
const objectURL = URL.createObjectURL(myBlob); | |
myImage.src = objectURL; | |
}); |
NewerOlder