Skip to content

Instantly share code, notes, and snippets.

View codewithtyler's full-sized avatar

Tyler Hughes codewithtyler

  • Alabama, United States
View GitHub Profile
@codewithtyler
codewithtyler / books.md
Last active April 11, 2022 18:50
Wealth/Finance Books I Own
  1. The 10X Rule
  2. The Richest Man In Babylon
  3. Back to Basics Debt Management
  4. The Ultimate Freelancer's Guidebook
  5. Traction: How Any Startup CanAchieve Explosive Customer Growth
  6. Dave Ramsey Total Money Makeover
  7. Dave Ramsey Financial Peace Revisited
  8. Atomic Habits
  9. Rich Dad's Before You Quit Your Job
  10. Tax Free Wealth
@codewithtyler
codewithtyler / virtual-machine-uses.md
Created December 22, 2020 15:30
20 Ways to Use a Virtual Machine (and other ideas for your homelab)

20 Ways to Use a Virtual Machine (and other ideas for your homelab)

This list was provided by TechnoTim and his video called 20 Ways to Use a Virtual Machine (and other ideas for your homelab). Go checko out his video here.

  1. Learning a new OS - Maybe you are using Windows or Mac and want to learn a new OS like Ubuntu, Linux Mint or even older operating systems like Windows 95, Windows 98 and more.
  2. Home Automation - using something like Home Assistant so you control all your IOT devices from a server at home without having to pay a subscription fee
  3. Web Server
  4. API
  5. Home Security - using something like BlueIris to record and handle all your home security cameras without having to pay a subscription fee
@codewithtyler
codewithtyler / presenceUpdate.js
Created September 27, 2020 02:16
Discord.js Presence Update event - Giving role for when user is live on Twitch
client.on( 'presenceUpdate', ( oldPresence, newPresence ) => {
if ( ( helper.isEmpty( newPresence ) || helper.isEmpty( newPresence.activities ) ) && !helper.isEmpty( oldPresence ) ) {
if ( oldPresence.member.roles.cache.some( role => role.name === helper.default_streaming_role ) ) {
const roleToRemove = oldPresence.guild.roles.find( role => role.name === helper.default_streaming_role );
oldPresence.member.roles.remove( roleToRemove );
logger.log( 'debug', `Removed ${roleToRemove.name} from ${oldPresence.user.tag} in ${oldPresence.guild.name} by oldPresence` );
// TODO: Convert these to embed logs for the guild
// logger.log( 'debug', `${userToUpdate.tag} has stopped streaming` );
}
@codewithtyler
codewithtyler / findingDuplicates.sql
Created August 13, 2020 16:15
Useful Oracle snippets
select column1, count( column2 )
from table
where column2 is not null
having count ( column2 ) > 1
group by column2

Pi-hole - A black hole for Internet advertisements

Ads, they're the bane of everyone's existance nowadays. It's hard to browse the internet without seeing a add somewhere on the page. Even if you're not using a desktop or laptop you can find ads everywhere, from mobile apps to your Smart TV. Today I'm going to talk about how we can potentially fix that. "How?" you may ask, well we're going to do it with some small cheap tech called a Raspberry Pi and about thirty minutes of your time.

Hardware Prerequisites

  1. Raspberry Pi (any model)
  2. Raspberry Pi power adapter
  • 5 Rasberry Pi 4's used for Kubernetes for running Docker containers
  • 5 Rasberry Pi 4's used for Rosetta@Home
  • 5 Rasberry Pi 4's user for Minecraft Server

  • Rasberry Pi 4's 4GB model - $55/each

  • 15 Sandisk SanDisk Ultra 128GB SDXC UHS-I Memory Card - $21/each

  • Subtotal ( does not include a power adapter, network switch, or a way to mount the Pi's ) - $1,140

  • Cost per 5 Raspberry Pi's (including SD Cards) - $380

@codewithtyler
codewithtyler / Get-PCInfo.ps1
Last active August 18, 2020 16:14
Get information about a PC (script may not work against any PC that's not running Windows Server)
# Prevents errors from showing in the console
$ErrorActionPreference = 'Stop'
$CPUInfo = Get-WmiObject Win32_Processor #Get CPU Information
$OSInfo = Get-WmiObject Win32_OperatingSystem #Get OS Information
$PhysicalMemory = Get-WmiObject CIM_PhysicalMemory | Measure-Object -Property capacity -Sum | % {[math]::round(($_.sum / 1GB),2)}
$TotalStorage = "C - " + ( [math]::Round( ( ( Get-Volume -DriveLetter C ).Size ) / 1GB, 1 ) ).ToString() + " GB"
$serverName = $CPUInfo.SystemName
if ( $CPUInfo.SystemName -is [array] ) {
@codewithtyler
codewithtyler / comparison.md
Last active January 28, 2021 05:06
Adding/Editing/Deleting Commands Via Chat for Each Chat Bot

This table lists the commands and variables you can use to create your own custom commands via Nightbot, StreamLabs, and StreamElements.

Command Description Nightbot StreamLabs StreamLabs Cloudbot StreamElements
Add Command !commands add !command_name your_text_goes_here !command add !command_name your_text_goes_here
Edit Command !commands edit !command_name your_text_goes_here !editcommand !command_name your_text_goes_here !command edit !command_name your_text_goes_here
Delete Command !commands delete !command_name
Last Game Played ${game ${1}}
@codewithtyler
codewithtyler / notes.md
Last active March 18, 2019 18:12
Light/Dark Mode Notes

Website Ideas for Dark Mode

  1. Add a toggle switch that lets the user dark mode on/off

Dark Mode

  • Background Color: #1A2029
  • Font Color: #FFFFFF

Light Mode

  • Background Color: #FFFFFF
  • Font Color: #333333
@codewithtyler
codewithtyler / .eslintrc
Created February 26, 2019 23:17
Urban Engine Default ESLint Config
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},