Skip to content

Instantly share code, notes, and snippets.

View h-sigma's full-sized avatar

Harshdeep Singh h-sigma

  • India
View GitHub Profile
public interface ITimeProvider
{
float renderDeltaTime { get; }
float fixedDeltaTime { get; } //ideally, do not include this, and use Time.fixedDeltaTime always
float renderTime { get; }
float fixedTime { get; }
}
public class TimeProvider : MonoBehavior
{
@sts10
sts10 / rust-command-line-utilities.markdown
Last active November 16, 2024 15:08
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@h-sigma
h-sigma / ReadMe.md
Last active June 8, 2020 21:30
An Attribute to use a c# property to get/set the value on a serialized field in the Unity Editor.

Drop ThroughPropertyAttribute.cs anywhere in Assets.

Drop ThroughPropertyDrawer.cs anywhere inside an Editor folder in Assets.

Attach Test to a gameobject to make sure it works. See the code in Test for an example.

Features:

  • Displays field as readonly if setter is missing.
  • Works with non-public getter/setters.
@h-sigma
h-sigma / DisplayAsEulerAttribute.cs
Last active June 7, 2020 19:30
An attribute in Unity to display radians, vectors, and quaternions in the form of human-readable Euler angles in the Editor.
using UnityEngine;
namespace Utility
{
public class DisplayAsEulerAttribute : PropertyAttribute
{
public float min;
public float max;
public DisplayAsEulerAttribute(float min = 0, float max = 359.9999f)
using System.Linq;
using UnityEditor;
namespace Editor.EditorScripts
{
public static class MenuItemsCollection
{
[MenuItem("GameObject/Replace", priority = 21)]
public static void ReplaceObjectInHierarchy(MenuCommand menuCommand)
{
@h-sigma
h-sigma / InterfaceAttribute.cs
Last active May 28, 2020 12:54
An attribute for MonoBehaviour's that restricts assigning in the editor to MB's deriving from a specific interface.
/*
* Author: Harshdeep Singh, https://github.com/h-sigma
* Year: 2020
* Description: An attribute for MonoBehaviour's that restricts assigning in the editor to MB's deriving from a specific interface.
* Use:
* [Interface(typeof<IHealth>)]
* public MonoBehaviour health;
* Note: This hasn't been bug tested, and it is a very simplistic way to do the job. If required or requested, I may choose to improve it.
*/
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing