Skip to content

Instantly share code, notes, and snippets.

@AntumDeluge
AntumDeluge / stendhal_simulate_combat.sh
Created June 22, 2023 05:46
Shell script to run Stendhal combat simulation.
#!/usr/bin/env bash
classpath="./:./libs/*:./build/build_stendhaltools/:./build/build_server/:./build/build_server_script/:./build/build_server_maps/:./build/build_server_xmlconf/"
defines=()
params=()
for arg in "$@"; do
echo "${arg}" | grep -q "^\-D";
ret=$?
@AntumDeluge
AntumDeluge / toidx.sh
Last active February 19, 2023 19:45
Script to Convert PNG Images to Indexed Color
#!/usr/bin/env bash
## Creative Commons Zero (CC0) public domain dedication
#
# To the extent possible under law, the author has
# waived all copyright and related or neighboring
# rights to this work. This work is published from:
# The United States.
#
## For more information see: https://creativecommons.org/publicdomain/zero/1.0/
@AntumDeluge
AntumDeluge / creature_spawn_points.txt
Last active May 28, 2022 20:08
Calculates drop rarity score for items
dark elf knight;9
Dhohr Nuggetcutter;1
babybear;11
assassin;151
dark elf general;8
littlewizard;44
djinn;29
barbarian chaman;4
elf bodyguard;8
bat;89
@AntumDeluge
AntumDeluge / cleanwhitespace.py
Last active March 15, 2022 11:52
Script to clean leading & trailing whitespace in text files.
#!/usr/bin/env python
## The MIT License (MIT)
#
# Copyright © 2022 Jordan Irwin (AntumDeluge)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
@AntumDeluge
AntumDeluge / genpreviews.py
Created August 12, 2021 18:12
Python script for creating Minetest skin preview images
#!/usr/bin/env python
# License header:
#
# The MIT License (MIT)
#
# Copyright (c) 2021 Jordan Irwin (AntumDeluge)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
@AntumDeluge
AntumDeluge / build_versioned_docs.sh
Last active August 16, 2021 08:28
LDoc config template for documenting Minetest mods
#!/usr/bin/env bash
# place this file in mod ".ldoc" directory
d_config="$(dirname $(readlink -f $0))"
cd "${d_config}/.."
d_root="$(pwd)"
@AntumDeluge
AntumDeluge / image_to_video.md
Created February 11, 2021 00:30
FFmpeg Single Image to Video

Convert image to video in FFmpeg

To convert a single image to video, use the -loop option to specify we are looping an image & the -t option to specify the duration of the resulting video:

-loop 1 -i <img_in> -t <duration>

To add empty audio, use the lavfi format with anullsrc input (change channel layout & sample rate as needed):

-f lavfi -i anullsrc=channel_layout=mono:sample_rate=44100
@AntumDeluge
AntumDeluge / semitrans_to_opaque.py
Last active March 11, 2022 03:43
GIMP plugin to convert semitransparent pixels to opaque
#!/usr/bin/env python
'''
Date: 2020-12-23
Description:
A simple GIMP plugin that duplicates & merges down the current
layer multiple times in order convert semitransparent pixels to
opaque without losing/changing color.
@AntumDeluge
AntumDeluge / CHANGES.txt
Last active September 30, 2022 16:24
A simple Python script that will convert any 3 column by 4 row N/E/S/W sprite sheet image to S/W/E/N.
1.1
- Fix temp file creation error when not calling script from source file directory.
1.0
- Initial release.
@AntumDeluge
AntumDeluge / stendhalserver.ps1
Last active April 23, 2020 06:01
PowerShell script for launching Stendhal server
<#
Public Domain dedication:
The author hereby relinquishes all rights to this work & dedicates
it to the Public Domain via Creative Commons Zero (CC0). See:
https://creativecommons.org/licenses/publicdomain/
#>