Skip to content

Instantly share code, notes, and snippets.

@luttje
luttje / CastableSkill.cs
Last active May 5, 2025 17:08
A copy of the SyncDictionary in Mirror Networking (Unity), except this will update a synced instance when an INotifyPropertyChanged event is raised
using Mirror;
using System;
using System.ComponentModel;
using UnityEngine;
public class CastableSkill : INotifyPropertyChanged
{
public SkillData skillData;
public double nextCastTime;
public uint currentPoints;
@luttje
luttje / pars-tampermonkey.js
Created February 29, 2024 10:55
Adds the option to hide names to PARS
// ==UserScript==
// @name PARS hide names option
// @namespace https://lutt.online
// @version 2024-02-22
// @description PARS hide names option
// @author Lutt.online
// @match https://pars.curio.nl/*
// @icon https://www.curio.nl/assets/images/favicons/favicon.ico
// @run-at document-body-end
// @grant none
@luttje
luttje / ASplinedBuilding.cpp
Last active February 3, 2024 11:11
Generate Convex Building along Spline (ProceduralMeshComponent)
#include "ASplinedBuilding.h"
#include "Components/SplineComponent.h"
#include "Components/SplineMeshComponent.h"
#include "ProceduralMeshComponent.h"
#include "Math/Color.h"
// Sets default values
ASplinedBuilding::ASplinedBuilding()
{
// Performance optimization, we only need the spline to exist after setting it up. No tick required.
@luttje
luttje / SYourLandscapeModule.cpp
Last active January 14, 2025 17:22
Unreal Engine 5 - Programatically create a landscape with spline points and segments
#include "LandscapeSubsystem.h"
#include "LandscapeComponent.h"
#include "LandscapeSplineActor.h"
#include "LandscapeSplinesComponent.h"
#include "LandscapeSplineControlPoint.h"
#include "Editor/LandscapeEditor/Private/LandscapeEdMode.h"
// Source: https://forums.unrealengine.com/t/creating-a-lanscape-using-c-or-the-python-api/504997/4
ALandscape* CreateLandscape(const FTransform& LandscapeTransform, const int32& SectionSize, const int32& SectionsPerComponent, const int32& ComponentCountX, const int32& ComponentCountY)
{
@luttje
luttje / _Caddy Server Setup.md
Created December 16, 2023 08:34
Caddy Server 2 - Laravel Project Setup with staging environment

Caddy Server 2 - Laravel Project Setup with staging environment

This setup shares some scripts to easily setup a Laravel project in Caddy using the caddy-api service.

Check out this setup for when you have multiple hosts and need a Reverse Proxy. It contains a more detailed explanation on how to use caddy-api

Warning

The configs below are modified slightly from my production environment (where they worked) and I haven't tested them since I changed 'em. Feel free to submit fixes and/or improvements as you find them.

@luttje
luttje / _Caddy Server Setup with Reverse Proxy.md
Last active December 16, 2023 08:35
Caddy Server 2 - Laravel Project Setup with Reverse Proxy and Staging environment

Caddy Server 2 - Reverse Proxy to 2 Laravel Backends

This explains how I setup Caddy with a Reverse Proxy to two Laravel backends on a Linux VPS. Use a reverse proxy like this is handy when your backends are running inside a Docker container, or on other hosts in the network.

Check out this setup for a simpler setup without a Reverse Proxy.

Warning

The configs below are modified slightly from my production environment (where they worked) and I haven't tested them since I changed 'em. Feel free to submit fixes and/or improvements as you find them.

@luttje
luttje / myx-enhancer-tampermonkey.js
Last active September 21, 2023 17:46
MyX Enhancer
// ==UserScript==
// @name MyX Schedule Enhancer
// @namespace http://lutt.online/myx-enhancer
// @version 0.2
// @description Adds useful features to MyX, by injecting ourselves into the page
// @author Lutt.online
// @match https://curio.myx.nl/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=myx.nl
// @run-at document-body
// @grant none
@luttje
luttje / iframe.html
Created April 29, 2023 21:19
Forces emojis on pages to use specific @font-face. Ensuring a uniform style across platforms
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Emojis in an iframe 🖼️</title>
</head>
<body>
<h1>
Emojis in an iframe 🖼️
</h1>
@luttje
luttje / ScriptAllowedAttribute.cs
Created August 26, 2021 22:07
Jint Allowlist to help decide which .NET members can be accessed from JavaScript (this is untested code, I copied this in part from a larger codebase)
[System.AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, Inherited = true)]
public class ScriptAllowedAttribute : Attribute
{
public ScriptAllowedAttribute() { }
}
@luttje
luttje / backup-repos.sh
Last active January 14, 2022 15:24
Backup script for my public & private repo's
#!/bin/sh
# Aa script to backup Github repositories to local
# Based on a script by Rong Zhuang:
# https://github.com/jojozhuang
# https://jojozhuang.github.io/tutorial/backup-github-repositories-to-synology-nas/
# The local path where the download repo's should be saved
BACKUP_PATH="/volume1/github"
# GitHub API URL