Skip to content

Instantly share code, notes, and snippets.

package net.minecraft.world.level.levelgen.synth;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.mojang.datafixers.util.Pair;
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
import it.unimi.dsi.fastutil.doubles.DoubleList;
import it.unimi.dsi.fastutil.ints.IntBidirectionalIterator;
import it.unimi.dsi.fastutil.ints.IntRBTreeSet;
import it.unimi.dsi.fastutil.ints.IntSortedSet;
@coderamen666
coderamen666 / imitatorbot_pub.py
Created March 22, 2023 20:40
Imitates celebs
import openai, praw, time
#OpenAI credentials
openai.api_key = "" # put OpenAI api key here
#Reddit Credentials
cl_id = "" # put client id here
cl_sec = "" # put client secret here
pword = "" # put reddit password here
uname = "" # put reddit username here
import socket, os, mimetypes
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(('0.0.0.0', 80))
s.listen()
while True:
conn, addr = s.accept()
with conn:
req = conn.recv(1024).decode("utf-8")
print(req)
@coderamen666
coderamen666 / wadread.py
Created June 13, 2023 05:05
A Python Script to read Doom Files
from PIL import Image
with open("DOOM1.WAD", 'rb') as f:
contents = f.read()
# IWAD or PWAD?
wad_type = contents[0:4].decode('ascii')
# Get Lump Count
lump_count = int.from_bytes(contents[4:8], 'little', signed=True)
@coderamen666
coderamen666 / A_VileChase.c
Created June 17, 2023 02:15
Modified A_VileChase from Chocolate Doom 3.0.1 with comments.
/*
The code responsible for crushing monsters to gibs in PIT_ChangeSector is this
// crunch bodies to giblets
if (thing->health <= 0)
{
P_SetMobjState (thing, S_GIBS);
thing->flags &= ~MF_SOLID;
thing->height = 0;