Skip to content

Instantly share code, notes, and snippets.

View h-sigma's full-sized avatar

Harshdeep Singh h-sigma

  • India
View GitHub Profile
@notnotrobby
notnotrobby / cgp.md
Last active June 29, 2025 07:04
List of free resources to study computer graphics programming.
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 June 28, 2025 07:56
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.
*/
@wojteklu
wojteklu / clean_code.md
Last active June 30, 2025 07:05
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@staltz
staltz / introrx.md
Last active June 28, 2025 13:44
The introduction to Reactive Programming you've been missing