Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
confirm() {
echo "Press RETURN to continue, or ^C to cancel.";
read -e ignored
}
RHEL_VER_FILE="/etc/redhat-release"
if [[ ! -f $RHEL_VER_FILE ]]
@ItsaMeTuni
ItsaMeTuni / CopyHelper.cs
Created July 14, 2018 18:12
A C# function to copy the values from one object to another (of the same type)
public static class CopyHelper
{
/// <summary>
/// Copies values of the fields from one object to another.
/// </summary>
/// <param name="_fromObj">Object you want to copy from.</param>
/// <param name="_toObj">Object you want to copy to./param>
/// <returns>Returns _toObj</returns>
public static object CopyValues(this object _fromObj, object _toObj)
@ItsaMeTuni
ItsaMeTuni / EnumMaskPropertyDrawer.cs
Created February 17, 2018 13:58
Adds a property drawer for enum bitmasks
/*
Written by: Lucas Antunes (aka ItsaMeTuni), lucasba8@gmail.com
In: 2/15/2018
The only thing that you cannot do with this script is sell it by itself without substantially modifying it.
*/
using System;
using UnityEngine;
#if UNITY_EDITOR
@ItsaMeTuni
ItsaMeTuni / InputHandler.cs
Last active October 6, 2017 12:56
This is a simple class used to bind delegates to a button and invoke that delegate when the button is pressed.
/*
Then attach this class to that object.
How this code works:
Create a button by going into Edit > Project Settings > Input and add a button.
You bind a delegate to that button.
Then when this class's update function is called it will check if the button is pressed.
If it is pressed then the delegate assigned to the button will be invoked.
*/