Skip to content

Instantly share code, notes, and snippets.

View StrangeRanger's full-sized avatar

Hunter T. StrangeRanger

View GitHub Profile
@StrangeRanger
StrangeRanger / matrix_phone_keywords.py
Last active March 8, 2026 00:55
A script that was written up for a scenario at a SkillsUSA programming competition. It was supposed to connect any of 10 specified keywords to a randomized phone number. If the randomized keyword is one of the 10 knowns keywords, the call is excepted, but if the keyword did not match any of the known keywords, the call is then denied. (status: u…
import random
import string
accepted_keywords = [
"(nothing)",
"abc",
"deft",
"ghi",
"jkl",
"mno",
@StrangeRanger
StrangeRanger / number_factoring.py
Last active July 23, 2025 20:08
Take a user provided integer and find all of the possible factors for that number. (status: finished)
#!/usr/bin/env python3
#
# Take a user provided integer and find all of the possible factors for that number.
#
# Notes:
# Does not find the factors of negative numbers.
#
# Version: v1.1.3
# License: MIT License
# Copyright (c) 2020-2021 Hunter T. (StrangeRanger)
@StrangeRanger
StrangeRanger / morse_code_converter.py
Last active July 23, 2025 20:07
Convert morse code to English and vise versa. (status: finished)
#!/usr/bin/env python3
#
# Convert morse code to English and vise versa.
#
# Notes:
# The script can only convert one way. If you mix morse code and English in your
# phrase/string, you will be asked to re-enter it.
#
# Version: v1.0.4
# License: MIT License
@StrangeRanger
StrangeRanger / heads_or_tails.py
Last active July 23, 2025 20:07
Digitally flip a coin x number of times and prints the number of times the outcome was heads and tails. (status: finished)
#!/usr/bin/env python3
#
# Digitally flip a coin x number of times and prints the number of times the outcome was
# heads and tails.
#
# Version: v1.0.3
# License: MIT License
# Copyright (c) 2020-2021 Hunter T. (StrangeRanger)
#
########################################################################################
@StrangeRanger
StrangeRanger / rock_paper_scissors.py
Last active July 23, 2025 20:06
A randomized rock paper scissors game for the purpose of observing probability. (status: finished)
#!/usr/bin/env python3
#
# A randomized rock paper scissors game for the purpose of observing probability.
#
# Reason For Creation:
# This little script was created because a math class required us to play rock paper
# scissors against someone to observe probability. I didn't have anyone to do it with
# at the time, so I created this.
#
# Version: v1.0.2
@StrangeRanger
StrangeRanger / currency_converter.py
Last active July 23, 2025 20:05
Using the API (https://api.exchangeratesapi.io/latest), this script converts one currency into another. (status: unsupported)
#!/usr/bin/env python3
#
# Using the API (https://api.exchangeratesapi.io/latest), this script converts one
# currency into another.
#
# Prerequisites:
# - requests
#
# IMPORTANT:
# This script no longer works as the API now requires an API key.
@StrangeRanger
StrangeRanger / spinning-stick.bash
Last active July 23, 2025 20:04
Examples of how to implement a spinning stick in the terminal, when waiting for a process to finish. (status: finished)
#!/usr/bin/env bash
#
# Sometimes, it's helpful to show users that a background process is running and the
# script is awaiting its completion. A common approach is to display a spinner in the
# terminal until the process finishes. This script offers two methods to implement such
# a spinner, catering to different needs and scenarios.
#
########################################################################################
####[ Global Variables ]################################################################
@StrangeRanger
StrangeRanger / Commit Types.md
Last active May 29, 2026 22:40
Outlines standardized commit types for all repositories, along with extended types for script/tool-focused repos. (status: personal)

Commit Conventions

This document outlines standardized commit types for all repositories, along with extended types for script/tool-focused repositories. The goal is to provide a clear, maintainable commit history, aid in automated changelog generation, and guide semantic versioning decisions.

These conventions are based on the Conventional Commits format:

<type>[optional scope]: <description>
@StrangeRanger
StrangeRanger / if-statements.bash
Last active July 23, 2025 20:11
Shows the difference between different tests statements, and how they behave when working with different kinds of variables. (status: finished)
#!/usr/bin/env bash
#
# shellcheck disable=SC2016
#
# The point of this script is to show the difference between the different kinds of if
# and test statements, and how they behave differently when dealing with different kinds
# variables.
#
########################################################################################
####[ Setup ]###########################################################################
@StrangeRanger
StrangeRanger / dotnet-sdk-not-found.bash
Last active July 23, 2025 20:11
Fixes problems caused by micosoft making .NET natively available on Ubuntu 22.04. For more information, refer to https://github.com/dotnet/core/issues/7699. (status: finished)
#!/bin/bash
#
# Fixes problems caused by micosoft making .NET natively available on Ubuntu 22.04. For
# more information, refer to https://github.com/dotnet/core/issues/7699.
#
# NOTE:
# This script specifically install dotnet-sdk-6.0 on Ubuntu 22.04 and Linux Mint 21.
# If you are using a different version of Linux and/or dotnet-sdk, you may need to
# manually modify the script to suit your needs.
#