Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
building things

Chuck Reynolds chuckreynolds

🤖
building things
View GitHub Profile
@chuckreynolds
chuckreynolds / html5-email-validation.htm
Created Mar 26, 2014
HTML5 Input Email Validation
View html5-email-validation.htm
<input type="text" title="email" required pattern="[^@]+@[^@]+.[a-zA-Z]{2,6}" />
@chuckreynolds
chuckreynolds / common-terminal-commands.md
Last active Sep 3, 2021
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

@chuckreynolds
chuckreynolds / nightbot-commands-reference.md
Last active Aug 15, 2021
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 / RPC Pint List
Last active Aug 11, 2021
Wordpress Ping Setup - updated mid-2021
View RPC Pint List
http://rpc.pingomatic.com/
https://rpc.twingly.com/
http://blogmatcher.com/u.php
http://ping.feedburner.com
http://ping.blo.gs/
http://www.weblogues.com/RPC/
http://www.blogdigger.com/RPC2
http://pingoat.com/goat/RPC2
https://www.pingmyblog.com/
http://blogsearch.google.com/ping/RPC2
@chuckreynolds
chuckreynolds / wordpress-change-domain-migration.sql
Last active Jul 27, 2021
UPDATE: Use WP-CLI find-replace command to edit URLs in your database. https://developer.wordpress.org/cli/commands/search-replace/ 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 https://developer.wordpress.org/cli/commands/search-replace/ */
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 */
View clickerheroes-legit-game-save.txt
egyRJi0tba3dRihBbJE0hQlhcVm99JMqZEXYZLlTbNHUMminOGj8MdzLNwTJIOs4I8nKRRvmd0GPF1saQYmH9JzicL0gtpprbIGjx4zeIGjeohxAMejXQEzxMDCPwAiRdgGa9V0JYUWfxFDKcEmIlh0jcpyRIp60MajjYY4DMDTJkLs8IanUBgyyZjXrZsM7bm2wd7p0bglcRiprbXWfV7z4dsGRFBtWcPCAIp6bM9TvQixFMyjLERySMlzkQuzKMUT7E9z9MbygwBiRdhGq9m0XYtWFxUVVcNGrd1yHY9WcR6lyc6yeIY6DMrTHU31uMkSQw5iAddGj9Z0AYBWBxrQ1cxm7lNtdYtWVxCzZSC27lGs5baGeVekWIqjfoIzzN1CfwjiEdBGDlutWZtWfxxhBcbH0NslOcSyxI36GM2Cuw9icbAGCFVzIdfFvBehrZ92bV1MzbT2dFAktVsGTlQtuZQSOIA6TMnCgwEiSbSWj9AzjdoExNcswabWBNSrwcD1PB0lYcXlINJlCYW2l9JuxZICpI96TMpjIQTs7Ilm9t3vcb5m0daJ6ZNCHIg6IIIicIJsCIRnwR1v9dYG8FEs4Q53jJplHZwGrld01ch11Bo11cQmTNiodYRXINdldZcCkIY6jMkC0w8iqdRmeVsyqck2Vl2vEbjimIx6RNNyqwWiQdxGJ9b0OYgWwxgNbbu2F5klJeRVjNAwfZhWa5u0qICjVonwCLYCmJotUYqXThhErc7HFMcimOrjmgauCMRzgIFx5MiTmAP3WMgDFYI2oNKzuEY3ENJzjVUliK1zAIX3bLbCbJ1zFb73YVjsgcf1CNewXZtWs5g0XIvjJolwmLdChJmzQb83GVGuGZsHmNzFUbzmZFOiqb8GZVTkgIljYpdmEYvWExozhZqStwji0c4HmJepQbsWlFisWUb289T1xbkHsMqiuOZjnEOsCI2mfxAhBcu3aRBM2bC2iFSkfVbGllctqZ3S9I06pMxCywuidbrX4VqzqaTWuNIFz
@chuckreynolds
chuckreynolds / current-weather-openweathermap.js
Created Mar 12, 2019
Open Weather Map API Current Weather, node js, javascript, axios
View current-weather-openweathermap.js
// API specific settings https://openweathermap.org/current
const API_URL = 'https://api.openweathermap.org/data/2.5/weather';
const API_KEY = '';
const LOCATION_CODE = '';
const FULL_API_URL = `${API_CURRENT_URL}?id=${LOCATION_CODE}&appid=${API_KEY}`;
axios
.get(FULL_API_CURRENT_URL)
.then(response => {
// Assign vars to response data
@chuckreynolds
chuckreynolds / affiliate-links.md
Last active May 14, 2021
Chuck's Affiliate links storage
View affiliate-links.md
@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;
}
@chuckreynolds
chuckreynolds / wp-local-media-nginx.txt
Last active Feb 17, 2021
Local NGINX WordPress Media Uploads Fallback. Substitute {PROD} for the domain to use images from.
View wp-local-media-nginx.txt
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ {
try_files $uri @image_fallback;
}
location @image_fallback {
proxy_pass http://{PROD};
}