Skip to content

Instantly share code, notes, and snippets.

View milobanks's full-sized avatar
🌇
Applying for jobs...

Milo (Miles) Banks milobanks

🌇
Applying for jobs...
View GitHub Profile
@milobanks
milobanks / setup_forge_modpack_server.sh
Created May 11, 2023 02:18
Given a zipfile with a modpack contained inside, it will download Forge, the mods, apply overrides, compile and upload a mod archive for clients, etc...
#!/bin/bash
set -e
if [ "$1" == "" ]; then
echo "Please supply a modpack zipfile as an argument."
exit 1
fi
if [ -d "./mods" ]; then

Bidrar (Contributing)

Hello, new (or returning developer)! To facilitate the smooth development of our project, we have taken numerous steps to ensure code quality and lower the probability of merge conflicts (when code you wrote clashes with another person's code).

Personlig åtkomsttoken (Personal Access Token)

In August of last year, Github deprecated passwords when pushing code to a remote (a repository hosted on the cloud, e.g. someone else's computer). Instead, they want you to use a Personal Access Token (PAT). Think of a PAT like a password, but you can have more than once, and each has different permissions. Don't worry, for now, you can have a single PAT that controls everything (you may want to create a unique one for each computer, in case one gets compromised).

Here's how you may create a PAT:

  1. Go to your profile

  2. Go to your settings

@milobanks
milobanks / extract.py
Created July 26, 2022 07:41
Hexspeak Generator
# This is a code clusterfuck.
non_hex_alphabet = ["G", "H", "I", "J", "K", "M", "L", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "-", "'", ".", ",", "\""]
words = []
with open("words.txt", "r") as f:
words = f.read().split("\n")
words = list(filter(lambda word: len(word) == 8 or len(word) == 4, words))
words = list(map(lambda word: word.upper(), words))
par std.fmt;
fn main() int {
let x = 42
fmt.println!("{}", c)
}
-- Possibility for how to write a Borofile
function install_target()
-- Install some things
os.rename("math/math", "${BORON_INST_PREFIX}/math")
end
function test_target()
-- Test some things
@milobanks
milobanks / hanoi.pl
Created April 10, 2020 18:27
Generalized tower of hanoi in Prolog!
/* README!
* The below prolog code (commented) is the original prolog code before I remembered
* that I had to make it work with six pillars, so I just spent a small bit of time
* (~1.5 hours) making the uncommented code accept any number of pillars.
*
* move(1, X, _, Z, [[X, Z]]). % Base case
* move(N, X, Y, Z, P) :- % To move N disks from X to Z
* M is (N - 1), % we first must move the smaller N-1 disks
* move(M, X, Z, Y, P1), % from X to Y
* move(1, X, Y, Z, P2), % then move the largest disk from X to Z
@milobanks
milobanks / install.sh
Created April 5, 2020 20:01
Homebrew install without "Press enter to continue"
#!/bin/bash
set -u
# First check if the OS is Linux.
if [[ "$(uname)" = "Linux" ]]; then
HOMEBREW_ON_LINUX=1
fi
# On macOS, this script installs to /usr/local only.
# On Linux, it installs to /home/linuxbrew/.linuxbrew if you have sudo access