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
/** | |
* WordPress dependencies | |
*/ | |
import { createPortal, useEffect, useState } from '@wordpress/element'; | |
import { registerPlugin } from '@wordpress/plugins'; | |
import { Button } from '@wordpress/components'; | |
function MyToolbarButton() { | |
// Lazy and one time initializations, also gives us a stable reference. | |
const [ container ] = useState( () => { |
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 | |
/** | |
* Place this file in the wp-content/mu-plugins directory and run ngrok with | |
* `ngrok http http://<local_url> --host-header=<local_url>` | |
*/ | |
$ngrok_url = '<id>.ngrok.io'; | |
define( 'WP_HOME', 'http://' . $ngrok_url ); | |
define( 'WP_SITEURL', 'http://' . $ngrok_url ); |
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
<? | |
# MIT license, do whatever you want with it | |
# | |
# This is my invoice.php page which I use to make invoices that customers want, | |
# with their address on it and which are easily printable. I love Stripe but | |
# their invoices and receipts were too wild for my customers on Remote OK | |
# | |
require_once(__DIR__.'/../vendor/autoload.php'); |
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 post list --post_type=post,page --field=ID | xargs -n1 -I % wp embed cache clear % |
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
/** | |
* Outputs a list of sanitized CSS class names. | |
* | |
* @param array|string $classes List of class names (array or string with | |
* class names separated by spaces or commas). | |
* @param bool $echo Echo the list of class names (defaults to true). | |
* @return void|array | |
*/ | |
function output_css_classes( $classes, $echo = true ) { |
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 | |
/** | |
* Block helpers | |
* add special classes when certain blocks appear, put this in your functions.php file or include it somewhere | |
*/ | |
// add block classes in body and post class | |
function blocks_body_class( $classes ) { | |
global $post; |
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 | |
# Bash script to set up local site using LAMP on Ubuntu | |
# Requires Apache2, MySQL, mkcert (https://github.com/FiloSottile/mkcert) | |
# See also sitedrop.sh https://gist.github.com/jonathanbossenger/4950e107b0004a8ee82aae8b123cce58 | |
HOME_USER=jonathan | |
SSL_CERTS_DIRECTORY=/home/jonathan/ssl-certs | |
SITES_DIRECTORY=/home/jonathan/development/websites |
NewerOlder