Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
building things

Chuck Reynolds chuckreynolds

🤖
building things
View GitHub Profile
@chuckreynolds
chuckreynolds / json-discord-embeds-twitch.json
Last active Aug 27, 2020
JSON embed scripts for Discord webhooks via IFTTT. Allowed avatar_url to be dictated by Discord in the webhook config.
View json-discord-embeds-twitch.json
{
"username":"twitch.tv/{{ChannelName}} [via RynoBot]",
"content":"@everyone {{ChannelName}} just went LIVE on Twitch! See you in chat! clintusHYPE",
"embeds":[
{
"title":"{{ChannelUrl}}",
"url":"{{ChannelUrl}}",
"color":6570404,
"thumbnail":{
"url":"https://static-cdn.jtvnw.net/jtv_user_pictures/b26daa03-975b-4a5d-9dea-a7fe9505a63f-profile_image-300x300.png"
@chuckreynolds
chuckreynolds / shopify-products-json-async-await.html
Created Jun 15, 2018
Vanilla Javascript fetch Shopify Products JSON with Async Await. Built as a text case for something. Just change the domain in line 17 to whatever shopify domain. Display is just basic for display purposes. Comments / code review welcome.
View shopify-products-json-async-await.html
<html>
<head>
<style>
.wrapper {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
grid-gap: 20px;
}
.box {
background-color: #ebebeb;
@chuckreynolds
chuckreynolds / affiliate-links.md
Last active Jan 26, 2021
Chuck's Affiliate links storage
View affiliate-links.md
View gist:3509561dda65df35075f87fb7adc629e
Verifying that "chuckreynolds.id" is my Blockstack ID. https://onename.com/chuckreynolds
@chuckreynolds
chuckreynolds / sample-wordpress-options-cache.php
Created Sep 18, 2017
Sample WordPress options with time-based cache flag
View sample-wordpress-options-cache.php
<?php
function get_twitter_followers() {
$ttl = 2 * HOUR_IN_SECONDS;
$cache = get_option( 'my_twitter_followers' );
if ( empty( $cache['timeout'] ) || $cache['timeout'] < time() ) {
$followers = wp_remote_get( ... );
$cache = array(
'count' => $followers,
View ngrok-to-local-vagrant.sh
./ngrok http -host-header=rewrite localsitename.app:80
@chuckreynolds
chuckreynolds / gist:c28d0957300b6b540dc295190ddfc1cb
Created Aug 29, 2017
WordPress: Disable users REST API endpoints
View gist:c28d0957300b6b540dc295190ddfc1cb
// Disable users REST API endpoints
add_action( 'rest_endpoints', function( $endpoints) {
foreach ( $endpoints as $endpoint => $args ){
if( false !== strpos( '/wp/v2/users', $endpoint ) ){
unset( $endpoints[ $endpoint ] );
}
}
return $endpoints;
});
@chuckreynolds
chuckreynolds / .editorconfig
Created Jun 8, 2017
my default starter editorconfig file.
View .editorconfig
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
View npm.json
{
"name": "gablaxian",
"version": "1.0.0",
"description": "gablaxian website",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/gablaxian/gablaxian.com.git"
},
@chuckreynolds
chuckreynolds / TwiMLbin-forwarding.xml
Created May 2, 2017
How to forward SMS and/or Calls with Twilio and TwiMLbins.
View TwiMLbin-forwarding.xml
// to forward a call and setup voicemail on timeout
<Response>
<Dial timeout="20" record="record-from-answer">xxx-xxx-xxxx</Dial>
</Response>
// to forward a sms to another number
<Response>
<Message to="+1xxxxxxxxxx">{{From}}: {{Body}}</Message>
</Response>