Skip to content

Instantly share code, notes, and snippets.

@techlemur
techlemur / list_blocks.js
Created February 11, 2019 21:19
get all available gutenberg block info for your site with javascript
/* Navigate to a wordpress edit page for any post and run one of the code sections below in a javascript console to get the names/info for all blocks available to gutenberg on your site. */
/* log all block info to console */
console.log(wp.data.select( "core/blocks" ).getBlockTypes());
/* log all block names to console */
wp.data.select( "core/blocks" ).getBlockTypes().forEach(function(element) {
console.log(element['name']);
});
@yangshun
yangshun / youtube-vimeo-url-parser.js
Last active June 14, 2023 22:27
YouTube Vimeo URL Parser
function parseVideo (url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
// - Also supports relative URLs:
// - //player.vimeo.com/video/25451551
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/