Skip to content

Instantly share code, notes, and snippets.

🤖
building things

Chuck Reynolds chuckreynolds

🤖
building things
Block or report user

Report or block chuckreynolds

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tessak22
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
drewm / shoot-sharing-image.js
Last active Aug 9, 2019
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
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
pento / php-block.js
Last active Sep 5, 2019
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
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
<?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
@smiley
smiley / README.md
Last active Sep 17, 2019
How to make an automatic "stream's live" notification for your Discord server
View README.md

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 https://ifttt.com/ 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
matthewzring / markdown-text-101.md
Last active Sep 19, 2019
A guide to Markdown on Discord.
View markdown-text-101.md

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
guydumais / functions.php
Last active Dec 14, 2018
WordPress ➧ Disable jQuery Migrate in WordPress
View functions.php
<?php
/**
* Disable jQuery Migrate in WordPress.
*
* @author Guy Dumais.
* @link https://en.guydumais.digital/disable-jquery-migrate-in-wordpress/
*/
add_filter( 'wp_default_scripts', $af = static function( &$scripts) {
if(!is_admin()) {
$scripts->remove( 'jquery');
@eslachance
eslachance / index.js
Last active Sep 22, 2019
Simple, complete example of a bot in Discord.js
View index.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");
@daggerhart
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
<?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);
You can’t perform that action at this time.