Skip to content

Instantly share code, notes, and snippets.

building things

Chuck Reynolds chuckreynolds

building things
View GitHub Profile
Oceas / wds-hello-world.php
Last active Aug 3, 2021
WDS WP-CLI 101 Complete
View wds-hello-world.php
Plugin Name: WDS Hello World
Plugin URI:
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI:
class WDS_CLI {
tessak22 / functions.php
Created Mar 12, 2019
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
View functions.php
* Register hero block
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
drewm / shoot-sharing-image.js
Last active Apr 30, 2021
Dynamic Social Sharing Images
View shoot-sharing-image.js
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 () => {
AdamSoucie / gist-block.js
Created Aug 17, 2018
Block.js file for Gist Gutenberg Block
View gist-block.js
* 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
pento / php-block.js
Last active Jul 10, 2021
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
View php-block.js
// 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.
jono-alderson / userAgentSEO.php
Last active Nov 29, 2018
Looks up the user agent against a known list, and outputs a HTML comment
View userAgentSEO.php
// Quick script to check and output the user agent in a HTML comment
// Jono Alderson []
// =================================
// Google user agent strings are sourced from
// []
// Feel free to add/edit definitions
// =================================
// Last updated: 20/03/2018
smiley /
Last active Oct 19, 2021
How to make an automatic "stream's live" notification for your Discord server

Making an automatic Twitch -> Discord notification (using IFTTT)

So you went live and you want everyone to know. Here's how you do it:

Part 1 - Register on IFTTT

Go to and create an account (if you don't already have one)

Part 2 - Make a Discord Webhook

  • Find the Discord channel in which you would like to send Tweets.
  • In the settings for that channel, find the Webhooks option and create a new webhook. Note: This URL should be kept private. It allows anyone to write messages to that specific channel using that specific URL. Keep it safe!
matthewzring /
Last active Oct 22, 2021
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__

guydumais / functions.php
Last active Apr 30, 2020
WordPress ➧ Disable jQuery Migrate in WordPress
View functions.php
* Disable jQuery Migrate in WordPress.
* @author Guy Dumais.
* @link
add_filter( 'wp_default_scripts', $af = static function( &$scripts) {
if(!is_admin()) {
$scripts->remove( 'jquery');
daggerhart / blog-not-public-admin-notice.php
Created Apr 12, 2017
Very simple WordPress plugin that warns a user if their blog can not be indexed by search engines.
View blog-not-public-admin-notice.php
* Plugin Name: Blog not public admin notice
* Description: Because this checkbox costs real people real money
* Version: 1.0.0
* Author: daggerhart
add_action( 'wp_ajax_dismiss_blog_not_public_notice', function(){
update_option('blog_not_public_notice_dismissed', 1);