Skip to content

Instantly share code, notes, and snippets.

@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;
@lambdan
lambdan / bundle.py
Created August 27, 2022 20:07
nopaystation rap/pkg bundler
# if you know you know
import os, shutil
out_folder = "./bundled/"
pkg_folder = "./packages/"
rap_folder = "./exdata/"
rap_files = []
@lambdan
lambdan / killall_oculus.bat
Created May 28, 2022 19:21
Kill all oculus vr processes to fix Oculus Link
REM Killall oculus to get rid of the botnets... or if Oculus Link just is stubborn for some reason...
REM Killing everything Oculus related, and then opening the Oculus app again usually fixes it
REM Run as admin!
REM Multiples because theyre stubborn sometimes
taskkill /f /im OculusClient.exe
taskkill /f /im OVRRedir.exe
taskkill /f /im oculus-platform-runtime.exe