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
chuckreynolds / wordpress-change-domain-migration.sql
Last active Jan 23, 2020
UPDATE: Use WP-CLI find-replace command to edit URLs in your database. Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: al…
View wordpress-change-domain-migration.sql
/* Use WP-CLI instead */
SET @oldsite='';
SET @newsite='';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
View clickerheroes-legit-game-save.txt
chuckreynolds / disable-rest-endpoints.php
Created Feb 20, 2017
WordPress: Disable WP REST API JSON endpoints if user not logged in
View disable-rest-endpoints.php
* Disable WP REST API JSON endpoints if user not logged in
function chuck_disable_rest_endpoints( $access ) {
if( ! is_user_logged_in() ) {
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'disable-json-api' ), array( 'status' => rest_authorization_required_code() ) );
return $access;
chuckreynolds /
Last active Nov 21, 2019
Nightbot commands reference for Twitch and sometimes youtube gaming. Most are accessible via google and reading many docs but I like to keep things in one location for reference. If you want to see something here lmk on Twitter: or comment below.

General stuff

Add, Edit, Delete Commands

  • !addcom !keyword New text here
  • !editcom !keyword Edited version of the text here
  • !delcom !keyword

Reference the user whom entered command

  • $(user)

Reference user-entered text

chuckreynolds /
Last active Oct 25, 2019
Chuck's Affiliate links storage
View lazy-load-youtube-embed.html
<!DOCTYPE html>
<title>Lazy load youtube embed</title>
<meta charset="UTF-8" />
<h1>Example of a lazy loaded embedded YouTube video</h1>
chuckreynolds /
Created Oct 21, 2019
How to Use Node.js and Github Webhooks to Keep Remote Projects in Sync - works for public repos only. Just storing this here for reference.
View twitch.badges.founder.subscriber.js
client.on('message', (channel, tags, message, self) => {
if(self) return;
const { badges, 'badge-info': badgeInfo } = tags;
let isSubscriber = false;
let monthsSubbed = -1;
if(badges) {
isSubscriber = badges.subscriber || badges.founder;
if(isSubscriber) {
monthsSubbed = badgeInfo.subscriber || badgeInfo.founder;
chuckreynolds / local-dev-remote-images.php
Created Apr 3, 2015
WordPress local dev environment plugin and config to use images from a live server instead of looking on local url path
View local-dev-remote-images.php
* Plugin Name: Local Dev Remote Images
* Description: this will allow a local dev environment to call all images in uploads from a remote server
* Version: 0.1
* License: GPL
* Author: @chuckreynolds
* Author URI:
chuckreynolds /
Last active Sep 3, 2019
Common linux / terminal commands I always use but forget. So fuck it I'm saving em here

common terminal commands

ubuntu updates & clean

  • sudo apt update && sudo apt upgrade -y
  • sudo apt autoremove && sudo apt clean

copy mac public ssh key

  • pbcopy < ~/.ssh/

edit host file and flush dns after

You can’t perform that action at this time.