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 / MS_Teams_Presence_NodeRed.js
Last active July 29, 2025 06:40
UserScript/TamperMonkey - Sends HTTP request to NodeRed HTTP Listener when web based Microsoft Teams status/presence changes to enable automated actions in NodeRed/HomeAssistant
// ==UserScript==
// @name Web Based Microsoft Teams Presence To NodeRed/HomeAssistant
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Sends HTTP request to NodeRed HTTP Listener when Web based Microsoft Teams status/presence changes to enable automated actions in NodeRed/HomeAssistant
// @author instance.id
// @match https://*.teams.microsoft.us/*
// @grant none
// ==/UserScript==
@instance-id
instance-id / CompileLocker.cs
Created November 24, 2021 16:21
Lock compilation so you can move folders and items without compiling on each one
using UnityEngine;
using UnityEditor;
// -- Place in Editor Folder ------------
namespace instance.id.Extensions.Editors
{
/// <summary>
/// This editor utility can lock/unlock unity script compile from menu item.
/// See more https://raspberly.hateblo.jp/entry/InvalidateUnityCompile
/// </summary>
@instance-id
instance-id / DragAssetConfirmation.cs
Created November 24, 2021 16:09
Unity Project View Asset Drag/Move Confirmation
// ----------------------------------------------
// -- Project View Asset Move Confirmation ------
// -- Place In Editor Folder --------------------
// ----------------------------------------------
using System;
using System.IO;
using UnityEditor;
internal sealed class DragAssetConfirmation : UnityEditor.AssetModificationProcessor
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-SSH/archive/master.zip"
Write-Host "Downloading latest version of Posh-SSH from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-SSH.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
$targetondisk = "$($env:USERPROFILE)\Documents\PowerShell\Modules"
New-Item -ItemType Directory -Force -Path $targetondisk | out-null
$shell_app=new-object -com shell.application
$zip_file = $shell_app.namespace($file)
@instance-id
instance-id / SassCompiler.cs
Last active October 7, 2022 08:01
Write UIToolkit style code using Sass and have it converted automatically to a .uss file, usable in Unity. (Linux/Windows, but PC needs to have Sass installed)
#if UNITY_EDITOR
using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.Diagnostics;
using UnityEngine.UIElements;
using Debug = UnityEngine.Debug;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
@instance-id
instance-id / flameshot-imgur.sh
Last active July 6, 2021 23:57
Using Flameshot as the screenshot capture tool with imgur-screenshot in place of scrot/maim, etc
#!/usr/bin/env zsh
# --------------------------------------------------------------------------------------------
# -- Using Flameshot (https://github.com/flameshot-org/flameshot) as the capture application
# -- with imgur-screenshot (https://github.com/jomo/imgur-screenshot) to upload imgur account
# --------------------------------------------------------------------------------------------
# -- borrowed these from the imgur-screenshot script ----
# -- to describe the filename format and output path ----
declare -g FILE_NAME_FORMAT="%Y-%m-%d_%H-%M.png"
declare -g FILE_DIR="${XDG_PICTURES_DIR:-$HOME/Pictures/upload}"
@instance-id
instance-id / _pc_setup_init.ps1
Last active April 20, 2021 02:27
Dev VM setup - still slightly WIP
# ------------------------------------------------- Dev PC Setup
# --------------------------------------------------------------
echo '-----------------------------'
echo 'Begin dev environment setup: '
echo '-----------------------------'
Update-ExecutionPolicy Unrestricted
# -------------------------------- Check for 10gb network adapter
$networkAdapter = Get-NetAdapter -InterfaceDescription 'Red Hat*' -ErrorAction SilentlyContinue | select -Property ifIndex
@instance-id
instance-id / RemoveGitString.ps1
Last active April 13, 2021 03:16
Search for and remove all directories that match a string from git tracking (Powershell on Linux host)
[CmdletBinding()]
param (
[Parameter()][String]$path = $HOME
)
$jobs = @()
$directories = @()
try {
Import-Module PoshRSJob
@instance-id
instance-id / Runspace_Module_Import.ps1
Last active April 13, 2021 18:23
Runspace testing. Probably best not to use it yet, though.
<#
.NOTES
=======================================================
Version: v0.1.00
Created: 04/11/2021
Platform: Linux/Windows
PSVersion: 7.2.4
=======================================================
.DESCRIPTION
Imports modules in separate runspace and returns them to main session
@instance-id
instance-id / Get-MostRecentPatchTuesday.ps1
Created April 8, 2021 23:08
Return the most recent 'Patch Tuesday' date in YYYY-MM-DD format
#region --------------------------------------- Get-PatchTuesday
# --- Modified from: https://github.com/tsrob50/Get-PatchTuesday
# --------------------------------------------------------------
Function Get-PatchTuesday {
[CmdletBinding()]
Param
(
[Parameter(position = 0)]
[ValidateSet('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')]
[String]$weekDay = 'Tuesday',