Skip to content

Instantly share code, notes, and snippets.

View InventivetalentDev's full-sized avatar
🏳️‍🌈

Haylee Schäfer InventivetalentDev

🏳️‍🌈
View GitHub Profile
@InventivetalentDev
InventivetalentDev / ArmorStandWrapper.java
Created April 25, 2020 19:14
ArmorStandCustomizer updateDisplay
public void updateDisplay(boolean hard) {
try {
Object dataWatcher = Reflection.getNMSClass("Entity").getDeclaredMethod("getDataWatcher").invoke(Reflection.getHandle(getWrapped()));
Object metaPacket = Reflection.getNMSClass("PacketPlayOutEntityMetadata").getConstructor(int.class, Reflection.getNMSClass("DataWatcher"), boolean.class).newInstance(getWrapped().getEntityId(), dataWatcher, false);
// int locX = (int) ((getWrapped().getLocation().getX()) * 32.0D);
// int locY = (int) ((getWrapped().getLocation().getY()) * 32.0D);
// int locZ = (int) ((getWrapped().getLocation().getZ()) * 32.0D);
//
// byte yaw = (byte) ((int) (getWrapped().getLocation().getYaw() * 256.0F / 360.0F));
{
"000000000002.075": {
"GUID": "000000000002.075",
"Name": "Reaper",
"Description": "Some speak of a black-robed terrorist known only as the Reaper. His identity and motives are a mystery. What is known is that where he appears, death follows.",
"Gender": "Male",
"Size": "Small",
"IsNpc": 1,
"SupportsAi": 1,
"GalleryColor": {
@InventivetalentDev
InventivetalentDev / file-cmd.md
Last active March 27, 2020 12:07
Linux Commands for Finding Files Filling up the Disk

Find Recently Changed Files (newer than 2 days, at least 1MB) - Useful for finding rogue logs

find -type f -mtime -2 -size +1M

Find the Largest Files

du -a / | sort -n -r | head -n 50

Delete all Files Older than 30 days

find ./* -mtime +30 -exec rm {} \;

Remove n first lines of a log file

@InventivetalentDev
InventivetalentDev / nbtHelper.js
Created October 30, 2019 14:48
Node NBT simplifier
function simplifyUnknownNbtValue(v) {
let s;
if (v.hasOwnProperty("tagMap")) {
s = simplifyNbtMap(v);
} else if (v.hasOwnProperty("tagList")) {
s = simplifyNbtList(v);
} else {
s = simplifyNbtData(v);
}
return s;
@InventivetalentDev
InventivetalentDev / ssd_mobilenet_v1_0.75_depth_quantized_300x300_cash.config
Last active July 25, 2019 11:49
Tensorflow Object Detection Config for Mobilenet - Continues on existing checkpoint
# SSD with Mobilenet v1 0.75 depth multiplied feature extractor, focal loss and
# quantized training.
# Trained on IIIT-Oxford pets, initialized from COCO detection checkpoint
# This config is TPU compatible
model {
ssd {
inplace_batchnorm_update: true
freeze_batchnorm: false
@InventivetalentDev
InventivetalentDev / ssd_mobilenet_v1_0.75_depth_quantized_300x300_cash.config
Last active July 24, 2019 18:23
Tensorflow Object Detection Config for Mobilenet - Starts a new Model
# SSD with Mobilenet v1 0.75 depth multiplied feature extractor, focal loss and
# quantized training.
# Trained on IIIT-Oxford pets, initialized from COCO detection checkpoint
# This config is TPU compatible
model {
ssd {
inplace_batchnorm_update: true
freeze_batchnorm: false
@InventivetalentDev
InventivetalentDev / removeDuplicates.js
Created March 4, 2019 15:59
Remove duplicate IDs from MongoDB
db.getCollection('...').aggregate(
{"$group" : { "_id": "$id", "count": { "$sum": 1 } } },
{"$match": {"_id" :{ "$ne" : null } , "count" : {"$gt": 1} } },
{"$sort": {"count" : -1} },
{"$project": {"id" : "$_id", "_id" : 0} }
)/*.forEach(function(r){
db.getCollection('---').remove({id:r.id})
})*/
@InventivetalentDev
InventivetalentDev / mongoBackup.sh
Created March 3, 2019 19:27
Simple MongoDB Backup script
#!/bin/sh
PREFIX="myServer"
MONGO_HOST="localhost"
MONGO_PORT=27017
MONGO_USER="admin"
MONGO_PASS="admin"
FTP_HOST="1.2.3.4"
FTP_USER="admin"
@InventivetalentDev
InventivetalentDev / premiumResourceEta.html
Last active September 12, 2020 11:11
Spigot Premium Resource ETA Calculator
<!-- https://tools.inventivetalent.org/premium-resource-eta/ -->
<div>
<form id="resourceForm" action=".">
<input type="number" id="resourceInput" required class="form-control" placeholder="Spigot Resource ID">
<button class="btn btn-primary" type="submit">Check</button>
</form>
<div id="result">
</div>
</div>
@InventivetalentDev
InventivetalentDev / versionPatch.java
Created February 16, 2018 18:13
Spiget Version Patch
public void patchVersions() {
System.out.println("=== RUNNING PATCH ===");
List<org.bson.Document> resources = databaseClient.getResourcesCollection().find().into(new ArrayList<>());
for (org.bson.Document document : resources) {
int resourceId = document.getInteger("_id");
System.out.println("Resource: " + resourceId);
List versions = (List) document.get("versions");