Skip to content

Instantly share code, notes, and snippets.

View foxfirecodes's full-sized avatar
🪲
debugging your code

foxfire foxfirecodes

🪲
debugging your code
View GitHub Profile
@foxfirecodes
foxfirecodes / README.md
Last active March 11, 2023 01:27
typecasts in TS are ok *sometimes*, right? ...... right..?

typecasts are bad.

image image

:))))
@foxfirecodes
foxfirecodes / search_blocks.md
Last active November 26, 2024 14:45
Search for blocks in a Minecraft world

search_blocks

a small Python script that uses amulet-core to search for specific blocks in a Minecraft world

this was created out of my need to find the exceptionally rare Osmium Ore in the Not Too Complicated 2 modpack

call it cheating if you like, but this is my 3rd playthrough of the pack and quite frankly i have much better things to do than fuck around trying to find a single goddamn vein of this shit.

if you want to use it, the general setup goes like this:

@foxfirecodes
foxfirecodes / diff-permission-overwrites.md
Last active August 31, 2020 21:28
Discord.js snippets for diffing changes of Discord permission overwrites

These are two potential scripts for computing (sane) diffs of permission overwrite changes on Discord channels with Discord.js.

setInterval(() => {
distSq = ast => {
let dx = playerX - ast.x;
let dy = playerY - ast.y;
return dx * dx + dy * dy;
};
justPressed.Space = !justPressed.Space;
let closest = asteroids.sort((a, b) => distSq(a) - distSq(b))[0];
dist = closest ? distSq(closest) : 10000;
keys.KeyW = !!closest && dist > 7500;
@foxfirecodes
foxfirecodes / levelup-value-stream.js
Created February 21, 2017 15:29
Just a demo of the oddity with LevelUP's createValueStream() method
const level = require('level');
const db = level('./testDB', { valueEncoding: 'json' });
async function main() {
await db.put('key-1', 'some value');
await db.put('key-2', '');
await db.put('key-3', -1);
await db.put('key-4', 0);
await db.put('key-5', 1);
@foxfirecodes
foxfirecodes / PlayerNames.java
Created September 10, 2016 15:09
Just a utility to keep track of associations between Player's UUIDs and names
package com.rayzr522.cubehomes;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;