Skip to content

Instantly share code, notes, and snippets.

@lambdan
lambdan / myrient_size.py
Last active January 4, 2025 13:38
Myrient: Calculate size of folder
# usage:
# python3 myrient_size.py URL
# OR
# python3 myrient_size.py URLS.txt
# (where URLS.txt contains 1 URL per line)
from bs4 import BeautifulSoup
import sys, requests
import urllib.parse
@lambdan
lambdan / install_chromium_130.sh
Last active December 7, 2024 18:30
Install chromium 130 on Debian amd64/arm64 (131 is broken on arm64)
#!/bin/sh
set -e
do_install() {
echo "#######################################################"
echo "# Chromium Install Script (modified 2024-12-07 19:29) #"
echo "#######################################################"
if [ -f "/etc/apt/sources.list" ]; then
# This is unneccessary (doesnt exist) for node:20 images atleast but just in case...
echo "Backing up existing sources.list"
@lambdan
lambdan / perforce_discord_bot.py
Last active April 17, 2024 22:30
Simple python script that just checks for p4 commits and sends them to a Discord webhook
import subprocess, time, os, requests
CHECK_INTERVAL = 1 # check changes every n secs
DISCORD_WEBHOOK = "https://discord.com/api/webhooks/..."
LAST_CACHE = "last.txt"
# read last commit from cache file
last = 0
if os.path.isfile(LAST_CACHE):
with open(LAST_CACHE,'r') as f:
@lambdan
lambdan / get_tags.md
Last active March 15, 2024 11:05
Blueprint node to get all tags of an Ability (Unreal Engine Gameplay Ability System GAS)

Preview

In .h file:

// Returns all tags related to this ability
UFUNCTION(BlueprintPure, Category="GAS|Ability|Tags")
void GetTags(FGameplayTagContainer & OutAbilityTags, FGameplayTagContainer & OutCancelAbilitiesWithTags, FGameplayTagContainer & OutBlockAbilitiesWithTags, FGameplayTagContainer & OutActivationOwnedTags, FGameplayTagContainer & OutActivationRequiredTags, FGameplayTagContainer & OutActivationBlockedTags, FGameplayTagContainer & OutSourceRequiredTags, FGameplayTagContainer & OutSourceBlockedTags, FGameplayTagContainer & OutTargetRequiredTags, FGameplayTagContainer & OutTargetBlockedTags, FGameplayTagContainer & OutCooldownTags);
@lambdan
lambdan / Unreal C++ Forward Declaration TLDR.md
Created January 23, 2024 11:50
Unreal C++ Forward Declaration TLDR

Unreal C++ Forward Declaration TLDR

In .h file:

In the .h file you forward declare:

#include ...
#include "...generated.h"
@lambdan
lambdan / get_running_exes.py
Created November 28, 2023 22:57
Get running exes in Python (as a list)
import os
def get_running_exes(): # https://www.geeksforgeeks.org/python-get-list-of-running-processes/
wmic_output = os.popen('wmic process get description, processid').read().strip()
items = wmic_output.split("\n")
exes = []
for line in items:
if ".exe" in line.strip():
exe = line.split(" ")[0].rstrip()
@lambdan
lambdan / WorldOfWarcraft_Font_Replace.bat
Created August 31, 2023 20:40
World of Warcraft font replacer bat script
@echo off
REM put this in your .../World of Warcraft/_game_version_/Fonts folder
REM then drag n drop a font onto it to replace the games fonts
del ARIALN.ttf
del DAMAGE.ttf
del FRIENDS.ttf
del FRIZQT__.ttf
del MORPHEUS.ttf
@lambdan
lambdan / reloadscene.cs
Created December 13, 2022 14:12
Reload current scene in unity
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
@lambdan
lambdan / illegal.cs
Last active November 1, 2022 22:14
yt-dlp audio download in Unity
// Requires yt-dlp.exe in %PATH% !!
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Windows;
public class IllegalScript : MonoBehaviour
{
private string savefolder;
private string current_url;
using TMPro;
using UnityEngine;
[RequireComponent(typeof(OnlineScoreRecorder))]
public class OldSchoolNameEntry : MonoBehaviour
{
[SerializeField] private TMP_Text _firstLetterButton;
[SerializeField] private TMP_Text _secondLetterButton;