Skip to content

Instantly share code, notes, and snippets.

@basnijholt
basnijholt / cto_line.pine
Created September 18, 2021 08:23
CTO Line indicator for TradingView
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)
@FleshMobProductions
FleshMobProductions / FbxBlenderOpeningProcessor.cs
Last active January 11, 2026 09:30
Double click a FBX file inside Unity and open it inside Blender properly (Windows only. User needs to edit blenderPath to point to their installation)
// Place inside an "Editor" folder
#if PLATFORM_STANDALONE_WIN
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
public static class FbxBlenderOpeningProcessor
{
@adammyhre
adammyhre / InspectorLock.cs
Last active January 14, 2026 04:33
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;
@thelebaron
thelebaron / SearchInspector.cs
Last active September 19, 2024 00:06
search for unity's inspector
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Junk.Utilities
{
/// <summary>
/// Thanks to Ryiah and the collective stolen knowledge of the internet via chatgpt
/// https://forum.unity.com/threads/still-no-search-field-in-the-inspector.1555850/#post-9697247
@adammyhre
adammyhre / FixUnityBrokenSelectionBase.cs
Created August 7, 2024 19:27
Custom Unity Editor Script to Fix [SelectionBase] for Consistent Parent Selection
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
// Put this in an Editor folder
[InitializeOnLoad]
public class FixUnityBrokenSelectionBase : Editor {
static List<Object> newSelection;
static Object[] lastSelection = { };