Skip to content

Instantly share code, notes, and snippets.

View Brandon-Gui123's full-sized avatar

Brandon Gui Brandon-Gui123

View GitHub Profile
@Brandon-Gui123
Brandon-Gui123 / rock_paper_scissors.py
Last active January 15, 2023 07:08
Rock Paper Scissors, written in Python
import random
print("Welcome to a game of Rock Paper Scissors!")
while True:
# ask whether to play rock, paper or scissors
user_choice = input("Choose one (rock, paper, scissors): ").strip().lower()
# validate input
@Brandon-Gui123
Brandon-Gui123 / StringExtensionsForUnity.cs
Last active August 27, 2021 05:07
Extension methods that allow you to quickly stylize your strings. This gist is made for C# and the Unity game engine.
// See https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html for an intro to rich text in Unity
/// <summary>
/// A set of extension methods for the <see cref="string"/> class
/// to make it fast and easy for you to stylize and log text.
/// </summary>
public static class StringExtensionsForUnity
{
/// <summary>Bolds the given string by surrounding it with &lt;b&gt; tags.</summary>
public static string Bold(this string str) => $"<b>{str}</b>";
@Brandon-Gui123
Brandon-Gui123 / check-commit-message.sh
Last active August 10, 2021 07:49
A Bash script that you can run to check if your commit message conforms to a specific format.
#!/usr/bin/bash
# How to use this Bash script:
# You can simply copy and paste the contents of this Bash script
# to your repository's .git/hooks/commit-msg file.
# Alternatively, copy and paste this file in your repository's .git/hooks
# directory and in commit-msg, type the following to execute this script:
# ./.git/hooks/check-commit-message.sh "$1"
# Note that the script exits with 0 when no issues are found, and 1
# when issues are found.