Skip to content

Instantly share code, notes, and snippets.

@Warr1024
Warr1024 / colors.txt
Created March 16, 2021 19:20
minetestmapper colors for NodeCore
# nc_adamant
nc_adamant:bar_annealed 107 124 133
nc_adamant:bar_hot 225 245 156
nc_adamant:bar_tempered 121 139 147
nc_adamant:block_annealed 107 124 133
nc_adamant:block_hot 225 245 156
nc_adamant:block_tempered 121 139 147
nc_adamant:cobble 100 117 136
nc_adamant:cobble_hot 65 65 65
nc_adamant:cobble_loose 100 117 136
@Warr1024
Warr1024 / README
Last active February 24, 2021 01:07
TiddlyWiki5 Offline ServiceWorker
Service worker that implements caching and offline fallback for a
TiddlyWiki5 instance with tiddlyweb saving hosted on nodejs.
This gives you the best of both worlds: a shared, synchronized wiki that
you can edit from anywhere and automatically syncs across multiple
devices, AND a fallback local version that you can still access when
offline, and will queue up changes to be uploaded when you're back
online later.
When you're offline, the wiki will still load, and you'll still have
@Warr1024
Warr1024 / nutestd.pl
Created May 29, 2020 17:28
nutestd: minetest server management/monitoring daemon
#!/usr/bin/perl -w
use strict;
use warnings;
use Sys::Syslog qw( :standard :macros );
use File::Spec::Functions qw(:ALL);
use File::Path qw(remove_tree mkpath);
use Getopt::Long;
use Cwd qw(cwd);
use IPC::Open3;
@Warr1024
Warr1024 / LICENSE
Last active March 9, 2022 00:49
Infinite IKEA Department Patch Mapgen
Copyright (C)2019 Aaron Suen <warr1024@gmail.com>
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 of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@Warr1024
Warr1024 / LICENSE
Last active March 9, 2022 00:53
txthud_* mods from NodeCore public server
Copyright (C)2018-2019 Aaron Suen <warr1024@gmail.com>
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 of the Software, and to
permit persons to whom the Software is furnished to do so, subject
to the following conditions:
'use strict';
const process = require('process');
const dgram = require('dgram');
// Command line args:
let [listenport, fwdport, fwdaddr, mindelay, maxdelay] = process.argv.slice(2);
// It will listen on <listenport> and act as a reverse proxy for the UDP service
// at <fwdaddr>:<fwdport>. All packets will be delayed by a uniformly
@Warr1024
Warr1024 / init.lua
Created October 5, 2019 23:36
Compute position of a ring in front of MT player around cursor.
vector.cross = vector.cross or function(a, b)
return {
x = a.y * b.z - a.z * b.y,
y = a.z * b.x - a.x * b.z,
z = a.x * b.y - a.y * b.x
}
end
local function project(player)
local camera_z = player:get_look_dir()
@Warr1024
Warr1024 / init.lua
Created September 19, 2019 20:16
Horizontal Spread Raycasting
local spread = math.pi / 16
local amount = 13
local range = 4
local function doraytrace(start, target)
for pointed in minetest.raycast(start, target, false, false) do
local pos = pointed.intersection_point
minetest.add_particle({
pos = pos,
exptime = 1,
local function append(x, a, ...)
if not a then return x end
return a, append(x, ...)
end
local function seek(n, x, ...)
if n < 0 then error() end
if n == 0 then return x end
return seek(n - 1, ...)
end
@Warr1024
Warr1024 / logbot.pl
Last active November 3, 2017 01:51
Simple Perl IRC bot that connects to a single IRC channel and passively listens and logs conversations to STDOUT. (C)2012 Warr1024, MIT License.
#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics qw(-t -w);
use POSIX;
use Getopt::Long qw(:config no_ignore_case bundling_override auto_help);
use Bot::BasicBot;
my $ircserver = 'localhost';