Skip to content

Instantly share code, notes, and snippets.

View zensharp's full-sized avatar
🌿
budding

Zensharp zensharp

🌿
budding
  • United States
View GitHub Profile
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 14, 2026 10:33
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@chelnak
chelnak / Get-LatestGithubRelease.ps1
Last active January 25, 2021 23:32
Download the latest zip ball release of a github project
# --- Set the uri for the latest release
$URI = "https://api.github.com/repos/chelnak/vRAAPIClient/releases/latest"
# --- Query the API to get the url of the zip
$Response = Invoke-RestMethod -Method Get -Uri $URI
$ZipUrl = $Response.zipball_url
# --- Download the file to the current location
$OutputPath = "$((Get-Location).Path)\$($Response.name.Replace(" ","_")).zip"
Invoke-RestMethod -Method Get -Uri $ZipUrl -OutFile $OutputPath
@capnslipp
capnslipp / NonDrawingGraphic.cs
Last active January 22, 2026 12:31
A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @creator: Slipp Douglas Thompson
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>.
/// @purpose: A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @why: Because this functionality should be built-into Unity.
/// @usage: Add a `NonDrawingGraphic` component to the GameObject you want clickable, but without its own image/graphics.
/// @intended project path: Assets/Plugins/UnityEngine UI Extensions/NonDrawingGraphic.cs
/// @interwebsouce: https://gist.github.com/capnslipp/349c18283f2fea316369
using UnityEngine;
using UnityEngine.UI;
@darkguy2008
darkguy2008 / UDPSocket.cs
Last active December 19, 2025 07:51
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 13, 2026 21:00
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
Shader "Noble Muffins/UI Additive" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
}
@Problematic
Problematic / LitParticle.shader
Created December 2, 2016 23:01
Standard-lit particle shader for Unity3D
Shader "Custom/Lit Particle" {
Properties {
_TintColor ("Tint Color", Color) = (1,1,1,1)
_MainTex ("Particle Texture", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
LOD 200
CGPROGRAM
@StephenHodgson
StephenHodgson / CustomAssetInspector.cs
Last active February 27, 2023 19:54
Unity custom inspector window to render markdown language as text asset.
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(DefaultAsset))]
public class CustomAssetInspector : Editor
{
public override void OnInspectorGUI()
{
@101v
101v / NatualScrollingInWindows.ps1
Created January 18, 2017 21:19
Powershell script to enable natural scrolling in Windows
# View registry settings
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
# Change registry settings
# Reverse mouse wheel scroll FlipFlopWheel = 1
# Normal mouse wheel scroll FlipFlopWheel = 0
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
# Restore default scroll direction
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 }
@TiliSleepStealer
TiliSleepStealer / DoomGlow.cs
Created June 13, 2017 21:45
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect