Skip to content

Instantly share code, notes, and snippets.

View Invertex's full-sized avatar
πŸ‘οΈβ€πŸ—¨οΈ
Doing too many things at once

Invertex Invertex

πŸ‘οΈβ€πŸ—¨οΈ
Doing too many things at once
View GitHub Profile
@primaryobjects
primaryobjects / hotspot-keep-alive.ps1
Last active March 8, 2026 15:48
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
# https://superuser.com/a/1434648
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
$netTask = $asTask.Invoke($null, @($WinRtTask))
$netTask.Wait(-1) | Out-Null
$netTask.Result
@Invertex
Invertex / CustomHoldingInteraction.cs
Last active April 23, 2026 13:05
Unity New Input System custom Hold "Interaction" where the .performed callback is constantly triggered while input is held.
using UnityEngine;
using UnityEngine.InputSystem;
//!!>> This script should NOT be placed in an "Editor" folder. Ideally placed in a "Plugins" folder.
namespace Invertex.UnityInputExtensions.Interactions
{
/// https://gist.github.com/Invertex
/// <summary>
/// Custom Hold interaction for New Input System.
/// With this, the .performed callback will be called everytime the Input System updates.
@popcron
popcron / CustomPlayBehaviour.cs
Last active May 26, 2022 01:31
Custom code before play
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace blablalblalmao
{
[InitializeOnLoad]
@Invertex
Invertex / StreamingAudioPlayer.cs
Last active November 12, 2024 14:12
Unity streaming audio playback example
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
namespace Invertex.Unity.Audio
{
/// <summary>
/// Component that allows playback of an audio file from a server or locally that begins playing before the file is completely downloaded.
/// </summary>
public class StreamingAudioPlayer : MonoBehaviour
@williamd1k0
williamd1k0 / EditorIconTexture.gd
Created May 6, 2024 23:46
Helper Texture class to use Godot Editor icons in plugins, such as main screen plugins.
@tool
class_name EditorIconTexture
extends AtlasTexture
var icon :String:
set(val):
icon = val
_update_icon.call_deferred()
func _init():
@Wavesonics
Wavesonics / remove-onedrive.ps1
Created June 25, 2024 02:08
A Shell script to remove OneDrive, move files to their proper directories, and fix paths in your registry
# Description:
# This script will remove and disable OneDrive integration.
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1
Write-Output "Kill OneDrive process"
taskkill.exe /F /IM "OneDrive.exe"
taskkill.exe /F /IM "explorer.exe"
@Invertex
Invertex / StandardShaderDoubleSided.shader
Created March 29, 2025 12:42
Unity Standard Shader that renders with proper double-sided lighting, not just culling disabled. Also uses the proper Standard shader GUI.
Shader "Invertex/Standard Double Sided" {
Properties {
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Roughness", Range(0.0, 1.0)) = 0.5
_GlossMapScale("Roughness Scale", Range(0.0, 1.0)) = 1.0
[Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0