Skip to content

Instantly share code, notes, and snippets.

View btarg's full-sized avatar

btarg btarg

View GitHub Profile
@btarg
btarg / Example.gd
Created September 8, 2024 18:23
Godot 4 GDScript sort dictionaries
extends Node
var test_dict: Dictionary = {"world": 2, "hello": 1, "test" : 3}
func _ready():
var sorted := sort_dictionary_values(test_dict)
print(sorted) # {"hello" : 1, "world" : 2, "test" : 3}
@btarg
btarg / index.html
Created January 8, 2024 16:31
HTML Minecraft server embed
<html>
<head>
<style>
#rest {
display: flex;
align-items: center;
justify-content: start;
flex-direction: row;
gap: 10px;
@btarg
btarg / ServerStart.sh
Created November 14, 2021 15:57
valhelsia 4 server start script
#!/bin/sh
# Valhelsia 4 Server Startup Script
# Edit the below values to change JVM Arguments or Allocated RAM for the server.
JAVA_PATH="java"
ALLOCATED_RAM="4G"
JVM_ARGUMENTS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch"
# Make sure this matches the Forge version of the server if you update.
FORGE_VERSION="1.17.1-37.0.108"
@btarg
btarg / discord_name.js
Last active March 24, 2021 15:08
Get Discord username from console (for browser user scripts and custom clients)
// Get Discord name from bottom left corner text box
const name = document.getElementsByClassName("size14-e6ZScH title-eS5yk3")[0].innerHTML;
const tag = document.getElementsByClassName("hovered-d5PMVU")[0].innerHTML;
const username_full = name + tag
@btarg
btarg / crashcreator.bat
Created January 18, 2021 01:16
Discord Crash Video Creator
@echo off
title Discord Crash Video Creator
color c
echo ========================= NOTE =========================
echo This script creates videos that crash Discord/Chrome.
echo Hardware acceleration must be enabled for it to work.
echo Crash videos will get you banned in some Discord groups!
echo.
echo FFmpeg needs to be installed for this to work:
@btarg
btarg / get-sm64pc.sh
Last active June 3, 2020 20:32
Download and build SM64PC for MYSYS2 on Windows (get-sm64pc) [LEGACY: get the new script here https://sm64pc.info/forum/viewtopic.php?f=4&t=2&i=2]
#!/bin/bash
# https://www.reddit.com/r/SM64PC/comments/ggnghp/how_to_download_sm64pc/fqno5zw?utm_source=share&utm_medium=web2x
# Please use -h or --help for usage.
# Setup
TEMP=$(getopt -o o:fh --long outpath:,flush,help -- "$@")
eval set -- "$TEMP"
# Defaults
@btarg
btarg / launch_minecraft.bat
Created November 5, 2019 17:44
Minecraft portable launcher windows
@echo off
title Minecraft
echo Launching Minecraft...
"%CD%\bin\Minecraft.exe" --workDir "%CD%\data\.minecraft"
@btarg
btarg / InitMods.cs
Created September 30, 2019 18:09
Mod.io Unity: Load mods
using System.Collections.Generic;
using UnityEngine;
using ModIO;
using System.IO;
public class InitMods : MonoBehaviour
{
public string bundleName = "modbundle";
// Start is called before the first frame update
@btarg
btarg / launch.sh
Created September 28, 2019 12:21
Launch Minecraft is Screen virtual terminal
#!/bin/bash
sudo screen -S mcs java -Xms1G -Xmx7G -d64 -jar server.jar nogui
@btarg
btarg / mc-setup.sh
Last active October 7, 2019 18:55
Google Cloud Minecraft server setup
#!/bin/bash
###########################################################
# Google Cloud Minecraft server setup
# Written by iCrazyBlaze
# Last edited 07/10/2019
###########################################################
path=/home/minecraft/server
backuphours=6