Skip to content

Instantly share code, notes, and snippets.

View SweptThrone's full-sized avatar
🐔

SweptThrone SweptThrone

🐔
View GitHub Profile
@SweptThrone
SweptThrone / ststamneu_hud.lua
Created September 8, 2022 22:52
STStamina Neu HUD
hook.Add( "HUDPaint", "DrawST2StaminaHUD", function()
local ply = LocalPlayer()
local stam = ply:GetStamina()
smoothStam = smoothStam or 100
smoothStam = Lerp( 15 * FrameTime(), smoothStam, stam )
surface.SetDrawColor( 0, 0, 0, 255 )
surface.DrawRect( 20, ScrH() - 15, LocalPlayer():GetStaminaCap() * 3, 5 )
@SweptThrone
SweptThrone / string_cleanse.js
Last active February 24, 2022 23:44
Replace common non-typeable characters with typeable versions.
/*
Name: StringCleanse
Author: SweptThrone (sweptthr.one)
Description: Replaces non-typeable characters in a provided string with typeable versions.
Returns: The cleansed string, or the original string if no valid non-typeable characters were found.
Argument: The string to cleanse.
UPDATE January 17, 2022: Added some outliers in the 0x21## range. Manually. Also changed some decimals to hex.
*/
function StringCleanse( str ) {