Skip to content

Instantly share code, notes, and snippets.

View instance-id's full-sized avatar

instance.id instance-id

View GitHub Profile
@instance-id
instance-id / dotnet_run_results.sh
Last active June 17, 2025 15:34
Comparing execution time of dotnet run vs. other scripting languages
zsh ❯ hyperfine --warmup 3 ./hello.sh
Benchmark 1: ./hello.sh
Time (mean ± σ): 814.4 µs ± 136.0 µs [User: 351.0 µs, System: 443.0 µs]
Range (min … max): 620.3 µs … 2240.3 µs 2548 runs
zsh ❯ hyperfine --warmup 3 ./hello.pl
Benchmark 1: ./hello.pl
Time (mean ± σ): 1.4 ms ± 0.2 ms [User: 0.4 ms, System: 1.1 ms]
Range (min … max): 1.1 ms … 2.2 ms 1461 runs
@instance-id
instance-id / BackgroundTaskScheduler.cs
Created June 1, 2025 02:58
Unity replacement for EditorApplication.delayCall using UniTask that can run in the background without needing Editor window focus
using System;
using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
@instance-id
instance-id / nifi_paste_behavior.md
Created May 28, 2025 17:27
Nifi parameter context paste behavior

How parameter contexts are handled when you paste a processor or process group in NiFi:

Where the Paste Logic Happens

  • The UI paste action starts in the frontend, notably in files like nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/service/copy-paste.service.ts and flow.effects.ts.
  • The actual merge and conflict logic for parameter contexts is handled on the backend, specifically in Java classes like ParameterContextReplacer.java and the ProcessGroupResource REST endpoint.

Parameter Context Paste Behavior (Overwrite, Merge, Ignore?)

Based on the code and documentation:

1. If the Parameter Context does NOT exist in the destination:

@instance-id
instance-id / __uv-python-shims.sh
Last active November 22, 2024 03:45
Create uv managed python shims (similar to pyenv shims)
#!/bin/bash
<<comment
============================================================
Last Edit: 11/21/2024
Created by: instance.id (https://github.com/instance.id)
Platform: Linux
Filename: uv-python-shims
============================================================
.DESCRIPTION
@instance-id
instance-id / intellij_eap_updater
Last active January 18, 2025 20:45
Generic script to update a JetBrains plugin to allow current Rider (and probably non-Rider IDE) EAP versions if the plugin tells you that you need to use an older version.
#!/usr/bin/env -S pwsh -noProfile -nologo
<#
.NOTES
============================================================
Last Edit: 10/14/2024
Created by: instance.id (https://github.com/instance-id)
Platform: Linux/Windows
Filename: intellij_eap_updater.ps1
PSVersion: Last tested with 7.4.x
@instance-id
instance-id / github_copilot_eap.ps1
Last active January 17, 2025 22:59
Update JetBrains github copilot plugin to allow current Rider EAP version
#!/usr/bin/env -S pwsh -noProfile -nologo
<#
.NOTES
============================================================
Last Edit: 10/20/2024
Created by: instance.id (https://github.com/instance-id)
Platform: Linux/Windows
Filename: github_copilot_eap.ps1
PSVersion: Last tested with 7.4.x
@instance-id
instance-id / hue_tap_dial_nodered.js
Created December 26, 2023 08:42
A script for a node-red function node to handle Hue Tap Dial rotation and button presses.
var action = msg.payload.action;
var direction = msg.payload.action_direction;
var step = msg.payload.action_time;
if (action == null || action == undefined || action == "") {
return;
}
var dialDirections = ["right", "left"];
var buttonNumbers = ["1", "2", "3", "4"];
@instance-id
instance-id / shell.csx
Created November 14, 2023 16:55
Shell call example
#!/usr/bin/env dotnet-script
#r "System.Console"
#r "System.Diagnostics.Process"
using System;
using System.Diagnostics;
public interface IShell
{
@instance-id
instance-id / unity_discussion.discourse.js
Created June 16, 2023 21:32
Unity Discussions Wide Screen Userscript - ViolentMonkey - (Newer Discourse board)
// ==UserScript==
// @name Unity Discussion(Discourse) WideScreen - unity.com
// @namespace Violentmonkey Scripts
// @match *://discussions.unity.com/*
// @grant none
// @version 0.1
// @author instance.id
// @description 6/16/2023, 4:17:24 PM
// ==/UserScript==
@instance-id
instance-id / UnityForumBoardSearchHelper.js
Last active June 15, 2023 16:51 — forked from unitycoder/UnityForumBoardSearchHelper.js
Unity Forum Search : AutoSelect current board item inside Search select list (based on referrer url)
// ==UserScript==
// @name Unity Forum Search : AutoSelect current board item inside Search select list (based on referrer url)
// @namespace https://unitycoder.com
// @version 1
// @include https://forum.unity.com/search/?type=post
// @grant none
// ==/UserScript==
// more info https://unitycoder.com/blog/2021/05/26/unity-forums-auto-select-current-subforum-in-search-greasemonkey-script/
// get referring board url