When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
/* | |
* This only works if you like to update the plugin. | |
* https://x.com/xaver_/status/1845760999908847628 | |
*/ | |
// load SCF from WP Engine servers | |
add_filter( 'pre_http_request', function ( $bool, $r, $url ) { | |
if ( false !== strpos( $url, '//downloads.wordpress.org/plugin/advanced-custom-fields.' ) ) { | |
$url = 'https://www.advancedcustomfields.com/latest/'; |
"abstract": " Squirrels are members of the family Sciuridae, a family that includes small or medium-size rodents. The squirrel family includes tree squirrels, ground squirrels, and flying squirrels. Squirrels are indigenous to the Americas, Eurasia, and Africa, and were introduced by humans to Australia. The earliest known fossilized squirrels date from the Eocene epoch, and among other living rodent families, the squirrels are most closely related to the mountain beaver and to the dormice.", |
// Inspired by https://towardsdatascience.com/quickly-extract-all-links-from-a-web-page-using-javascript-and-the-browser-console-49bb6f48127b | |
var atags = document.querySelectorAll("a"); | |
let links = []; | |
let hashes = {}; | |
for await (atag of atags){ | |
var anchor = atag.textContent.replace(/\s+/g, ' ').trim(); | |
var link = atag.href.replace(/\/$/, ""); // remove trailing slash | |
var rel = atag.rel; | |
var hash = md5(link) |
<?php | |
/* | |
Plugin Name: WDS Hello World | |
Plugin URI: https://webdevstudios.com/ | |
Description: Teaching the basics of WP-CLI | |
Author: Web Dev Studios | |
Version: 1.0.0 | |
Author URI: https://webdevstudios.com/ | |
*/ | |
class WDS_CLI { |
/** | |
* Register hero block | |
*/ | |
add_action('acf/init', 'hero'); | |
function hero() { | |
// check function exists | |
if( function_exists('acf_register_block') ) { | |
// register a hero block |
const puppeteer = require('puppeteer'); | |
const imagemin = require('imagemin'); | |
const imageminPngquant = require('imagemin-pngquant'); | |
// Get the URL and the slug segment from it | |
const url = process.argv[2]; | |
const segments = url.split('/'); | |
const slug = segments[segments.length-2]; | |
(async () => { |
/** | |
* BLOCK: wds-gist | |
*/ | |
// Import CSS. | |
import './style.scss'; | |
import './editor.scss'; | |
const { __ } = wp.i18n; // Import __() from wp.i18n | |
const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks |
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
<?php | |
// Quick script to check and output the user agent in a HTML comment | |
// Jono Alderson [https://www.jonoalderson.com] | |
// ================================= | |
// Google user agent strings are sourced from | |
// [https://support.google.com/webmasters/answer/1061943?hl=en] | |
// Feel free to add/edit definitions | |
// ================================= | |
// Last updated: 20/03/2018 |