Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
class rom {
public:
rom ( ifstream & stream );
~rom();
@TerrorBite
TerrorBite / ircbotframe.py
Last active February 20, 2023 05:21
Python IRC chat bridge for Vanilla Minecraft
import socket
import threading
import re
import time
class ircOutputBuffer:
# Delays consecutive messages by at least 1 second.
# This prevents the bot spamming the IRC server.
def __init__(self, irc):
self.waiting = False
@TerrorBite
TerrorBite / X-Clacks-Overhead.conf
Last active December 24, 2023 02:48
GNU Terry Pratchett
# The Hour of the Dead was when men died. And when a man died, they sent him
# home by clacks.
#
# Moist's mouth dropped open. 'Huh?'
#
# 'That's what they call it,' said Harry. 'Not lit'rally, o' course. But they
# send his name from one end of the Trunk to the other, ending up at the tower
# nearest his home.'
#
@TerrorBite
TerrorBite / calc256.py
Last active September 14, 2015 12:10
#!/usr/bin/env python
from sys import argv, stdin, stdout, stderr
from traceback import print_exc
from os import path, isatty
from textwrap import dedent
from collections import Counter
from math import sqrt
import inspect
# Luminance threshold values
@TerrorBite
TerrorBite / aloop.c
Created June 6, 2015 10:43
Seamless audio player
#include <unistd.h>
#include <stdio.h>
#include <ao/ao.h>
#include <fcntl.h>
#include <signal.h>
#include <math.h>
#include <mad.h>
#include <string.h>
#include <sys/types.h>
/*
Piston Elevator Controller
A Space Engineers script by TerrorBite
(Not just for elevators! Can be used any time that you want a piston to move to a
certain preset length and then turn off.)
WARNING: You may experience some lag while the piston is moving (especially after running
the game for a long time). This is unavoidable and is a result of the Program Block being
run repeatedly and rapidly by a Timer Block in order to monitor the piston. I have taken
/* Piston Controller script for Space Engineers - by TerrorBite */
const float TOLERANCE = 0.08F;
string status = "";
Dictionary<string, string> Properties;
void LoadProperties() {
Properties = new Dictionary<string, string>();
if(string.IsNullOrEmpty(Storage)) return;
string[] records = Storage.Split('\x1E');
@TerrorBite
TerrorBite / build.sh
Created February 26, 2016 00:02
Framebuffer rendering thing
#!/bin/sh
gcc -std=gnu99 -o fbtoy main.c framebuffer.c draw.c -lm -g
Start End Event Name Waypoint Link
07:00 07:15 Tequatl the Sunless [&BNABAAA=]
11:30 11:45 Tequatl the Sunless [&BNABAAA=]
16:00 16:15 Tequatl the Sunless [&BNABAAA=]
19:00 19:15 Tequatl the Sunless [&BNABAAA=]
00:00 00:15 Tequatl the Sunless [&BNABAAA=]
03:00 03:15 Tequatl the Sunless [&BNABAAA=]
08:00 08:15 Evolv. Jungle Wurm [&BKoBAAA=]
12:30 12:45 Evolv. Jungle Wurm [&BKoBAAA=]
17:00 17:15 Evolv. Jungle Wurm [&BKoBAAA=]
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: chat.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2