Skip to content

Instantly share code, notes, and snippets.

View glektarssza's full-sized avatar

G'lek Tarssza glektarssza

View GitHub Profile
@glektarssza
glektarssza / nvidia_transcode.sh
Last active March 13, 2026 13:20
ffmpeg Hardware Transcoding 10-bit HEVC to 8-bit H.264 with NVIDIA CUDA
#!/usr/bin/env bash
declare -a CMD_LINE
# We're running ffmpeg, of course
CMD_LINE+=(ffmpeg)
# Don't bother showing the ffmpeg banner, accept prompts by default
CMD_LINE+=(-hide_banner -y)
# Optionally limit CPU threads, really shouldn't be needed since everything is on the GPU
#CMD_LINE+=(-threads 8)
@glektarssza
glektarssza / args.sh
Created March 3, 2026 19:08
Steam Linux Proton Arguments
# Each argument does the following:
# PROTON_USE_WINED3D - Boot the game using Wine3D instead of DXVK which can break older Unity-based games.
# Only enable if you're playing a Unity-based game that isn't launching in Proton!
# GAMEMODERUNEXEC - Set the CLI command to run the game with inside of `gamemoderun`
# gamemoderun - Run the game inside of `gamemode`, which changes some Linux settings for better gaming performance.
# %command% - The game's command, which get's passed to `gamemoderun`.
PROTON_USE_WINED3D=1 GAMEMODERUNEXEC="mangohud prime-run" gamemoderun %command%
@glektarssza
glektarssza / HashCodeImpl.java
Last active January 26, 2026 09:10
Java hashCode Implementation
// Source - https://stackoverflow.com/a/31220250
// Posted by Christopher Rucinski, modified by community. See post 'Timeline' for change history
// Retrieved 2026-01-26, License - CC BY-SA 3.0
import java.util.Arrays;
import javax.annotation.Nullable;
public class HashCodeImpl {
public boolean booleanField;
public byte byteField;
@glektarssza
glektarssza / all-scopes.txt
Last active September 22, 2025 08:37
GitHub OAuth Scope List
"repo","repo:status","repo_deployment","public_repo","repo:invite","security_events","admin:repo_hook","write:repo_hook","read:repo_hook","admin:org","write:org","read:org","admin:public_key","write:public_key","read:public_key","gist","notifications","user","read:user","user:email","user:follow","project","read:project","read:project","write:packages","read:packages","delete:packages","admin:gpg_key","write:gpg_key","read:gpg_key","codespace","workflow","read:audit_log"
@glektarssza
glektarssza / show_settings.lua
Last active September 17, 2025 03:25
Factorio - Warp Drive Machine Helper Scripts
-- Some constants
local re = "${(%w+)}"
local color_fmt = "[color=${c}]${v}[/color]"
local player = game.player
local printing_entity = player
--- @type PrintSettings
local print_settings = {
sound = defines.print_sound.never,
skip = defines.print_skip.never,
game_state = false,
@glektarssza
glektarssza / dump-8bit-colors.sh
Created September 12, 2025 16:02
Dump the full range of 8-bit terminal colors in a nice table format!
#!/usr/bin/env bash
# Dump the full range of 8-bit colors available in the terminal!
# RAINBOWS!
function dump_8bit_colors() {
# -- Forward declare variables!
local FG;
for i in {0..255}; do
FG="15";
if [[ $(( ("$i" - 16) % 36 )) -eq 0 ]]; then
@glektarssza
glektarssza / get_script_dir.sh
Created September 10, 2025 14:26
Get Script Directory
# Useful one liner to get the script directory from almost any location.
declare SCRIPT_DIR;
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)";
# Useful one liner to get the script directory from almost any location.
declare SCRIPT_DIR;
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)";
# Multi-line solution to get the script directory from any location.
declare SCRIPT_SOURCE SCRIPT_DIR;
@glektarssza
glektarssza / gtnh-mod-dupe-checker.ps1
Created September 7, 2025 21:45
GTNH Mod Duplication Checker Script
git status --porcelain | Select-String -Raw -Pattern '^\?\?' | ForEach-Object { return (($_ -split '^\s*(\?\?)\s+')[1] -split "-", 2)[0]; } | ForEach-Object { return Get-ChildItem -File -Filter "$((Split-Path $_)[-1])*" ".minecraft/mods"; } | Select-Object -Unique | Group-Object -Property { Write-Debug "Inspecting mod file `"$_`"..."; return ([System.Text.RegularExpressions.Regex]::new("(.+?)((\d+\.?){1,3}\d+)[^\d]*").Matches($_.BaseName).Groups[1]); } | Where-Object -Property Count -GE 2 | Select-Object -Property Name, @{Label = "Group"; Expression = { return $_.Group | ForEach-Object { return @{File = $_; Version = [System.Text.RegularExpressions.Regex]::new("(.+?)((\d+\.?){1,3}\d+)[^\d]*").Matches($_).Groups[2] }; } } } | Format-Table -Property @{Label="Mod Name"; Expression={$_.Name.Trim("-")}}, @{Label = "Files"; Expression = { return $_.Group | Join-String -Separator "`n" -Property { return $_.File.BaseName; } } }, @{Label = "Versions"; Expression = { return $_.Group | Join-String -Separator "`n" -Prope
@glektarssza
glektarssza / discord-timer-anti-experiment.userscript.js
Last active September 5, 2025 22:47
Remove Discord Voice Channel Activity Timer Experiment Tampermonkey Userscript
// ==UserScript==
// @name Remove Discord Voice Channel Activity Timer Experiment
// @namespace http://glektarssza.com/
// @version 0.0.1
// @description Removes the experiment that adds timers to Discord voice channels indicating how long they've been active for.
// @author G'lek Tarssza
// @copyright 2025 G'lek Tarssza
// @match https://discord.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=discord.com
// @grant none
@glektarssza
glektarssza / glfw-style-updater.user.js
Last active July 17, 2025 15:39
GLFW Style Updater Tampermonkey Script
// ==UserScript==
// @name GLFW Documentation Style Updater
// @namespace http://glektarssza.com/
// @version 0.1.1
// @description Update the styling on `https://glfw.org` to make it less retina-destroying.
// @license MIT
// @author G'lek Tarssza
// @homepage https://glektarssza.com
// @website https://glektarssza.com
// @source https://gist.github.com/glektarssza/e2a4af934377782e482f624595a3ed13/raw