Skip to content

Instantly share code, notes, and snippets.

@nickludlam
nickludlam / start_dev_client.bat
Created March 11, 2026 21:44
Start a dev client to connect to a local server for mod testing
@echo off
:: 1. Path to the game (NOT the server)
set "GAME_ROOT=E:\SteamLibrary\steamapps\common\Arma Reforger"
set "GAME_EXE=%GAME_ROOT%\ArmaReforgerSteam.exe"
set "GAME_DATA=%GAME_ROOT%\addons"
:: 1. Path to the game Executable
set "SERVER_DIR=E:\SteamLibrary\steamapps\common\Arma Reforger Server\arma_reforger"
set "SERVER_EXE=%SERVER_DIR%\ArmaReforgerServerDiag.exe"
@nickludlam
nickludlam / start_dev_server.bat
Created March 11, 2026 21:43
Start a dev server on Windows for local mod testing
@echo off
:: 1. Path to the game Executable
set "SERVER_DIR=E:\SteamLibrary\steamapps\common\Arma Reforger Server\"
set "SERVER_EXE=%SERVER_DIR%\ArmaReforgerServer.exe"
:: 2. Path to the Game Data (The core game folder)
set "GAME_ROOT=E:\SteamLibrary\steamapps\common\Arma Reforger"
set "GAME_DATA=%GAME_ROOT%\addons"
@nickludlam
nickludlam / gist:919bdf0d5274ffbe65af5cb5f26d133f
Created March 6, 2026 14:16
LLM written Agents.md for Svelte 5
# Code Assistant Directives for Svelte 5 Runes
This document directs code assistants to write code using **Svelte 5 Runes**, the new reactivity model in Svelte 5.
## Overview
Svelte Runes are a set of powerful APIs that provide fine-grained reactivity in Svelte 5. When writing or modifying code in this project, always use runes instead of the legacy reactive declarations and statements.
## Core Runes
@nickludlam
nickludlam / gist:44c80462c773465d34251b7b12f4724d
Created April 27, 2025 20:20
Arma Reforger Server Config - Local Testing (remove 'local' to bind to a public IP)
{
"bindAddress": "0.0.0.0",
"bindPort": 2001,
"publicAddress": "local",
"publicPort": 2001,
"a2s": {
"address": "0.0.0.0",
"port": 17777
},
"game": {
@nickludlam
nickludlam / SCR_CampaignSeizingComponent.c
Created April 4, 2025 22:17
Arma Reforger conflict cap point speed calculations
override void RefreshSeizingTimer()
{
if (!m_fSeizingStartTimestamp)
return;
int servicesCount;
if (m_Base)
{
array<SCR_EServicePointType> checkedTypes = {
@nickludlam
nickludlam / ResourceQueryWorldEditorTool.c
Last active March 1, 2025 14:37
Enfusion resource query tool: Scripts/WorkbenchGame/EnfusionMapMaker/ResourceQueryWorldEditorTool.c
[WorkbenchToolAttribute(name: "Entity Query Tool", description: "Queries the map for resources, inside an AABB, and allows you to reject based on substring of the XOB path", wbModules: {"WorldEditor"}, awesomeFontCode: 0xf6e2)]
class EntityQueryWorldEditorTool: WorldEditorTool
{
////////////////////////////
// State vars
World m_currentWorld;
ref array<IEntity> m_entityResults = null;
ref array<string> m_excludeStringArray = null;
@nickludlam
nickludlam / personalize_mammoth.rb
Last active February 21, 2024 16:15
This file will adapt the Mammoth git repo to a personal bundle identifier and development team, so it becomes locally buildable
#!/usr/bin/env ruby
# File: personalize_mammoth.rb
# Description: Adapt the Mammoth project to a personal bundle identifier and development team
# and change the entitlements files to match the desired bundle identifier
# When run again, it will revert the changes
# Usage: ruby personalize_mammoth.rb
# Deps: xcodeproj
require 'xcodeproj'
@nickludlam
nickludlam / svelte_experience.md
Last active February 19, 2024 17:54
A Rails guy learns SvelteKit

My experience coming to SvelteKit from Rails and Ruby

This is specifically because my experience in webdev is very informed by Ruby on Rails. I've done plenty of work with strongly typed languages, but never webdev. My experience is also from 2018 and older, so there may well be modern solutions that achieve parity with the clever things I'm finding in SvelteKit that I feel were not as present in Rails work. Don't at be bro!

Strong types are extraordinary at catching inter module communication issues. Any time you’re putting polymorphic messages into Redis, etc. Also it's very nice having a strongly typed, schema-aware database client. The auto-completion is very useful.

Idea: make some playgrounds to show examples live

Frustrations

Sometimes the VSCode plugins don’t update when you push prisma schema changes

@nickludlam
nickludlam / test-form.svelte
Last active February 4, 2024 14:43
In this scenario we want to have a <Slider/> component driving a numeric 'volume' value within the form, but also have an input element where you can type the value
<script lang="ts">
import { onDestroy } from "svelte";
import { writable } from "svelte/store";
import type { SuperValidated } from "sveltekit-superforms";
import { formFieldProxy, superForm } from "sveltekit-superforms/client";
import * as Form from "$lib/components/ui/form";
import { Slider } from "$lib/components/ui/slider";
@nickludlam
nickludlam / gist:7d3d8bf83fd5f6b0768bf04ddf11bc9f
Created January 17, 2024 19:13
Grabbing this from a Slack post by twitter.com/kieran_nee - How to be a good dev in a studio
## Good Conduct
- Fix all warnings in your code before commits
- I don’t want to have to turn on Warnings as Errors, but I will if I have to discuss this more than a few times.
- Keep an eye on runtime warnings. If they’re ones you’ve introduced, fix them before committing.
- If they’re ones you think you can fix, please fix them.
- If you aren’t sure what’s causing them. Let the rest of the team know so someone who knows the root cause can fix them.
- Check your references for NULL and handle gracefully, don’t just assume they exist.
- If you see something broken
- FIX IT if you are confident you know how and it won’t massively impinge on your current work