Skip to content

Instantly share code, notes, and snippets.

@knolaust
knolaust / filter-gutenbergblocks-cpt.php
Last active August 6, 2024 02:32
Allow/disallow certain blocks for specific post types and custom post types in WordPress' Gutenberg Editor
<?php
/**
* Allowed Block Types Configuration
* Gist Keywords: wordpress, editor, gutenberg, blocks
*
* @category WordPress
* @author Knol Aust
* @version 1.0.0
* @description Limit the blocks allowed in Gutenberg for improved content control.
<?php
// CSV files > CSV file
function mergeCSV(array $input = [], string $output = '')
{
$count = 0;
foreach (glob($input) as $file) {
if (($handle = fopen($file, 'r')) !== false) {
@mfehrenbach
mfehrenbach / chrome-device-dimensions.md
Last active July 11, 2025 16:46
Modern device dimensions for Chrome DevTools.

Modern Device Dimensions for Chrome DevTools

These are modern “Emulated Devices” (a.k.a. responsive dimensions) for Chrome DevTools’ Mobile Device Viewport Mode.

They are specifically Apple devices, subtracting for recent Safari UI (as in window.innerWidth/Height), and cleverly sorted with some dark-arts unicode shenanigans. (This glitchy, unloved portion of the tools sorts lexicographically, because of course it would.) Ergonomics!

 

Note

Updated June 2025 with some notes from folks below! TL;DR: use Vibranium!