Skip to content

Instantly share code, notes, and snippets.

View StrangeRanger's full-sized avatar

Hunter T. StrangeRanger

View GitHub Profile
@StrangeRanger
StrangeRanger / _clang-format
Last active April 6, 2023 02:05
C# _clang-format configuration file (works for 'clang-format version 16.x.x')
View _clang-format
---
Language: CSharp
# BasedOnStyle: Microsoft
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
@StrangeRanger
StrangeRanger / dotnet-sdk-not-found.sh
Last active September 7, 2022 18:34
Fixes problems cause by micosoft making .NET natively available on Ubuntu 22.04. For more information, refer to https://github.com/dotnet/core/issues/7699.
View dotnet-sdk-not-found.sh
#!/bin/bash
#
# Fixes problems cause by micosoft making .NET natively available on Ubuntu 22.04. For
# more information, refer to https://github.com/dotnet/core/issues/7699.
#
########################################################################################
#### [ Variables ]
## Modify output text color.
View if-statements
#!/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 / Commit Types.md
Last active December 6, 2022 19:46
Commit Types.md
View Commit Types.md
@StrangeRanger
StrangeRanger / spinning-waiting-stick
Last active April 6, 2023 18:33
spinning-waiting-stick.sh
View spinning-waiting-stick
#!/usr/bin/env bash
#
# Provides two different methods that can be used to display a spinning stick that will
# continue to spin until a specific process is finished running.
#
# NOTE: 'method_two' is notiblely faster than 'method_one'. Despite this, it does not
# speak for the method's actual speed. That is dependent on how you use and
# implement the methods. For the case of the examples that I provided, 'method_one'
# is slower because I have it check if the incremented number is greater than or
# equal to the specified stopping number, for every iteration of the for loop.
@StrangeRanger
StrangeRanger / _clang-format
Last active July 4, 2023 12:44
Java _clang-format configuration file (works for 'clang-format version 14.x.x')
View _clang-format
---
Language: Java
# BasedOnStyle: Chromium
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left # Maybe: Previously None
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
@StrangeRanger
StrangeRanger / currency_converter.py
Last active July 21, 2022 11:43
currency_converter.py
View currency_converter.py
#!/usr/bin/env python3
#
# Prerequisites:
# Install globally: `python3 -m pip install requests`
# Install locally via pipenv: `pipenv install requests`
#
# Version: v1.0.3
# License: MIT License
# Copyright (c) 2020-2021 Hunter T. (StrangeRanger)
#
@StrangeRanger
StrangeRanger / rock_paper_scissors.py
Last active March 7, 2022 19:51
rock_paper_scissors.py
View rock_paper_scissors.py
#!/usr/bin/env python3
#
# Reason For Creation: The creation of this little script was due to the fact that 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
# License: MIT License
# Copyright (c) 2020-2021 Hunter T. (StrangeRanger)
@StrangeRanger
StrangeRanger / heads_or_tails.py
Last active March 7, 2022 19:51
heads_or_tails.py
View heads_or_tails.py
#!/usr/bin/env python3
#
# Version: v1.0.3
# License: MIT License
# Copyright (c) 2020-2021 Hunter T. (StrangeRanger)
#
########################################################################################
"""
Digitally flip a coin x number of times and prints the number of times the outcome was
heads and tails.
@StrangeRanger
StrangeRanger / morse_code_converter.py
Last active March 7, 2022 19:51
morse_code_converter.py
View morse_code_converter.py
#!/usr/bin/env python3
#
# Version: v1.0.4
# License: MIT License
# Copyright (c) 2020-2021 Hunter T. (StrangeRanger)
#
########################################################################################
"""
Convert morse code to English and vise versa.