Skip to content

Instantly share code, notes, and snippets.

Avatar
🦆
quamck

TehBrian ItsTehBrian

🦆
quamck
View GitHub Profile
View ez-116-colors.java
/* Prefer using adventure or something, but if you need something tiny.. */
public static final Pattern HEX_PATTERN = Pattern.compile("&(#[A-Fa-f0-9]{6})");
public static String color(String string) {
return string == null ? null : replaceHex(ChatColor.translateAlternateColorCodes('&', string));
}
public static String replaceHex(String str) {
Matcher matcher = HEX_PATTERN.matcher(str);
while (matcher.find()) {
@ItsTehBrian
ItsTehBrian / 1-16-minecraft-map-palette.gpl
Created Jul 7, 2020
Allowed colors in maps for Minecraft 1.16.
View 1-16-minecraft-map-palette.gpl
GIMP Palette
67 94 29 Untitled
89 125 39 Untitled
109 153 48 Untitled
127 178 56 Untitled
130 123 86 Untitled
174 164 115 Untitled
213 201 140 Untitled
247 233 163 Untitled
@ItsTehBrian
ItsTehBrian / google_sheets
Last active Apr 27, 2020
Nice little formulas I use in Google Sheets.
View google_sheets
This little string sets the cell to the amount of words in another cell, relative to that cell.
I don't know why this was so hard to find, I feel like it should be easier than this, but whatever.
Replace "-2" with however many to the left or right you want to go in that column, or use row, or whatever.
=IF(INDIRECT(ADDRESS(ROW(), COLUMN()-2))="", "", COUNTA(SPLIT(INDIRECT(ADDRESS(ROW(), COLUMN()-2)), " ")))
This thing puts the first word of the cell to the left by one, you can change the numbers as usual.
=IF(INDIRECT(ADDRESS(ROW(), COLUMN()-1))="", "", LEFT(INDIRECT(ADDRESS(ROW(), COLUMN()-1)), FIND(" ", INDIRECT(ADDRESS(ROW(), COLUMN()-1)))-1))
@ItsTehBrian
ItsTehBrian / debug.sh
Last active Jul 3, 2020
Minecraft Server debug script.
View debug.sh
#!/bin/sh
echo Debug script activated!
cd "$( dirname "$0" )"
RAM=3G
SERVER_JAR=server.jar
DEBUG_PORT=30024
# Line below uses Aikar's flags. Keep it updated.
@ItsTehBrian
ItsTehBrian / start.sh
Last active Jul 3, 2020
Minecraft Server start script.
View start.sh
#!/bin/sh
echo Start script activated!
cd "$( dirname "$0" )"
RAM=3G
SERVER_JAR=server.jar
# Line below uses Aikar's flags. Keep it updated.
java -Xms$RAM -Xmx$RAM -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar $SERVER_JAR nogui
@ItsTehBrian
ItsTehBrian / .gitignore
Last active Apr 5, 2020
A very nice .gitignore for IntelliJ Java projects.
View .gitignore
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
@ItsTehBrian
ItsTehBrian / reset.scss
Last active Sep 28, 2019 — forked from hcatlin/reset.scss
Reset SCSS
View reset.scss
/* http://meyerweb.com/eric/tools/css/reset/ | v2.0 | 20110126 | License: Public Domain | Modified a bit by TehBrian <3 */
html,
body,
div,
span,
applet,
object,
iframe,
h1,