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 March 23, 2025 17:56
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!

before-after

Nest Hub Max? Come on. I dropped a bunch of devices that were older and/or close to these dimensions. It obviously doesn’t cover everything (sorry Android/Chrome), but offers a decent spread/increments for common 2023/2024 viewports.