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
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
<?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;
}
View clickerheroes-legit-game-save.txt
egyRJi0tba3dRihBbJE0hQlhcVm99JMqZEXYZLlTbNHUMminOGj8MdzLNwTJIOs4I8nKRRvmd0GPF1saQYmH9JzicL0gtpprbIGjx4zeIGjeohxAMejXQEzxMDCPwAiRdgGa9V0JYUWfxFDKcEmIlh0jcpyRIp60MajjYY4DMDTJkLs8IanUBgyyZjXrZsM7bm2wd7p0bglcRiprbXWfV7z4dsGRFBtWcPCAIp6bM9TvQixFMyjLERySMlzkQuzKMUT7E9z9MbygwBiRdhGq9m0XYtWFxUVVcNGrd1yHY9WcR6lyc6yeIY6DMrTHU31uMkSQw5iAddGj9Z0AYBWBxrQ1cxm7lNtdYtWVxCzZSC27lGs5baGeVekWIqjfoIzzN1CfwjiEdBGDlutWZtWfxxhBcbH0NslOcSyxI36GM2Cuw9icbAGCFVzIdfFvBehrZ92bV1MzbT2dFAktVsGTlQtuZQSOIA6TMnCgwEiSbSWj9AzjdoExNcswabWBNSrwcD1PB0lYcXlINJlCYW2l9JuxZICpI96TMpjIQTs7Ilm9t3vcb5m0daJ6ZNCHIg6IIIicIJsCIRnwR1v9dYG8FEs4Q53jJplHZwGrld01ch11Bo11cQmTNiodYRXINdldZcCkIY6jMkC0w8iqdRmeVsyqck2Vl2vEbjimIx6RNNyqwWiQdxGJ9b0OYgWwxgNbbu2F5klJeRVjNAwfZhWa5u0qICjVonwCLYCmJotUYqXThhErc7HFMcimOrjmgauCMRzgIFx5MiTmAP3WMgDFYI2oNKzuEY3ENJzjVUliK1zAIX3bLbCbJ1zFb73YVjsgcf1CNewXZtWs5g0XIvjJolwmLdChJmzQb83GVGuGZsHmNzFUbzmZFOiqb8GZVTkgIljYpdmEYvWExozhZqStwji0c4HmJepQbsWlFisWUb289T1xbkHsMqiuOZjnEOsCI2mfxAhBcu3aRBM2bC2iFSkfVbGllctqZ3S9I06pMxCywuidbrX4VqzqaTWuNIFz
@chuckreynolds
chuckreynolds / wordpress-change-domain-migration.sql
Last active Nov 22, 2019
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: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
View wordpress-change-domain-migration.sql
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
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 */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@chuckreynolds
chuckreynolds / nightbot-commands-reference.md
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: https://twitter.com/chuckreynolds or comment below.
View nightbot-commands-reference.md

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
chuckreynolds / affiliate-links.md
Last active Oct 25, 2019
Chuck's Affiliate links storage
View affiliate-links.md
View lazy-load-youtube-embed.html
<!DOCTYPE html>
<html>
<head>
<title>Lazy load youtube embed</title>
<meta charset="UTF-8" />
</head>
<body>
<main>
<h1>Example of a lazy loaded embedded YouTube video</h1>
<iframe
@chuckreynolds
chuckreynolds / nodejs-github-webhook-webservice.md
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 nodejs-github-webhook-webservice.md
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
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
<?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: https://chuckreynolds.us
*/
@chuckreynolds
chuckreynolds / common-terminal-commands.md
Last active Sep 3, 2019
Common linux / terminal commands I always use but forget. So fuck it I'm saving em here
View common-terminal-commands.md

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/id_rsa.pub

edit host file and flush dns after

You can’t perform that action at this time.