Skip to content

Instantly share code, notes, and snippets.

View rodgtr1's full-sized avatar

Travis Rodgers rodgtr1

View GitHub Profile
@rodgtr1
rodgtr1 / python_exercises.py
Last active April 29, 2024 15:25
Python exercises for Python Tutorial - https://youtu.be/f1E1NvcRvdc
# Install and Setup
# REPL
# VSCode & Extension
# 1. Variables / Types
@rodgtr1
rodgtr1 / BikeChain.sol
Created April 24, 2022 03:30
The Smart Contract for the BikeChain app built in my YouTube tutorial - here.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract BikeChain {
address owner;
constructor() {
owner = msg.sender;
@rodgtr1
rodgtr1 / CryptoKids.sol
Created April 7, 2022 12:31
CryptoKids Solidity Smart Contract - Tutorial at https://youtu.be/s9MVkHKV2Vw
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
contract CryptoKids {
// owner DAD
address owner;
event LogKidFundingReceived(address addr, uint amount, uint contractBalance);
@rodgtr1
rodgtr1 / sendBirthdayGreeting.go
Last active July 10, 2021 17:32
Lambda Function To Automate Birthday Greetings From CSV Written in Go
package main
import (
"encoding/csv"
"encoding/json"
"fmt"
"os"
"time"
"github.com/aws/aws-lambda-go/lambda"
@rodgtr1
rodgtr1 / bitbucket-pipelines.yml
Created July 10, 2021 17:29
Bitbucket Pipeline to SFTP Files Up To WordPress Server
pipelines:
branches:
master:
- step:
name: Deploy to staging
deployment: staging
script:
- pipe: atlassian/sftp-deploy:0.5.7
variables:
USER: $SFTP_USERNAME
@rodgtr1
rodgtr1 / uptimeMonitor.sh
Created July 2, 2021 14:17
Uptime Monitor for Ghost (or really any Linux service)
#!/bin/bash
#ver. 4
##this script will check mysql and apache
##if that service is not running
##it will start the service and send an email to you
##if the restart does not work, it sends an email and then exits
##set the path ##this works for Ubuntu 14.04 and 16.04
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@rodgtr1
rodgtr1 / awsCLIAutomation.sh
Created July 2, 2021 14:13
Script to authenticate with AWS CLI with MFA token
#!/bin/bash
set -e
# specify your MFA_DEVICE_ARN
MFA_DEVICE_ARN=YOURMFAARN
PATH_TO_CREDENTIALS_FILE=/path/to/.aws/credentials
echo $PATH_TO_CREDENTIALS_FILE
#1H = 3600
#2H = 7200
#3H = 10800
@rodgtr1
rodgtr1 / bitcoin_price_alert.py
Created June 27, 2018 02:27
Bitcoin email alerts when the price drops to a specific amount
import requests
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import getpass
def send_email():
# create message object instance
msg = MIMEMultipart()
@rodgtr1
rodgtr1 / functions.php
Created April 12, 2018 02:27
Change Default Search Text - Genesis
//Change default search text
function themeprefix_search_button_text( $text ) {
return ( 'Custom search phrase...');
}
add_filter( 'genesis_search_text', 'themeprefix_search_button_text' );
@rodgtr1
rodgtr1 / functions.php
Created April 12, 2018 02:26
Add a Custom Favicon - Genesis
/** Adding custom Favicon */
add_filter( 'genesis_pre_load_favicon', 'custom_favicon' );
function custom_favicon( $favicon_url ) {
return 'http://example.com/wp-content/uploads/favicon.png';
}