Skip to content

Instantly share code, notes, and snippets.

@hibiii
hibiii / horse_average_breeds_until_speed.lua
Created January 26, 2024 00:08
Lua script to calculate how many times you'd need to breed horses in Minecraft to get to at least a target speed
if #arg < 1 then
print 'usage: <your command> target [speed1] [speed2]'
print 'units are in m/s.'
print 'if the parents are missing, they\'re assumed to be average of 9.4m/s.'
os.exit(1)
end
--- The number of simulation runs.
local tries = tonumber(os.getenv("TRIES")) or 1000
@hibiii
hibiii / ifmutil.sh
Created June 25, 2023 03:21
Bash device to allow selecting files for file management in a more interactive way
# Interactive File Management Utilities by hibi
#
# This source file will let you select individual files and copy and move them
# around much like a graphical file manager would. Intended to be used with
# `source` in your bashrc.
#
# Usage:
# Fsel name1 [name2 [...]] - selects files and folders
# Funsel [name1 [name2 [...]]] - unselects files and folders, or all
# Fcp [destination] - copies the files here or to destination
@hibiii
hibiii / cat.zig
Last active April 11, 2023 21:23
Example cat program in Zig
// cat example in zig - by hibi
const std = @import("std");
// good practices
const logger = std.log.scoped(.cat);
pub fn main() !void {
const stdout = std.io.getStdOut();
var args = std.process.args();
defer args.deinit();