Skip to content

Instantly share code, notes, and snippets.

@TerrorBite
TerrorBite / X-Clacks-Overhead.conf
Last active August 29, 2015 14:18
GNU Terry Pratchett
View X-Clacks-Overhead.conf
# 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 / aloop.c
Created June 6, 2015 10:43
Seamless audio player
View aloop.c
#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>
View pistoncontroller_v2.cs
/* 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 / calc256.py
Last active September 14, 2015 12:10
View calc256.py
#!/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 / storage.yml
Created March 25, 2012 15:03
TradingPost storage format
View storage.yml
storage:
==: net.lethargiclion.tradingpost.TradeStorage
currentId: 1
trades:
- ==: net.lethargiclion.tradingpost.TradeOffer
id: 0
owner: TerrorBite
status: open
timestamp: 2012-02-21T13:07:40.100Z
items:
@TerrorBite
TerrorBite / ChatListener.java
Created June 24, 2012 13:35
Player connection/chat/command logging plugin for Bukkit
View ChatListener.java
package org.mcau.plugins.logmcau;
import java.util.logging.Logger;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
public class ChatListener implements Listener {
@TerrorBite
TerrorBite / gist:3615555
Created September 4, 2012 01:22 — forked from anonymous/gist:3615358
minmax
View gist:3615555
//This code works. Put in the commented out statements, doesn't work anymore.
#include<stdio.h>
#include<limits.h>
#include<ctype.h>
int main()
{
int number=0;
int min=INT_MAX;
@TerrorBite
TerrorBite / HuntContest.md
Created November 24, 2012 01:54
Planning document for the HuntContest plugin
View HuntContest.md

HuntContest

This plugin was heavily inspired by Matejdro's MonsterHunt plugin. It is a complete rewrite from the ground up, introducing a fairer and more advanced style of play that hopefully brings more fun.

Features

There are 3 play modes, depending how many players joined:

  • Singleplayer - Beat your high score to win!
  • This gamemode is activated if only one player is signed up for a hunt.
View mantisPlugin.php
<?php
/*
* Installation:
* require_once("extensions/MantisIntegration/MantisIntegration.php"); in LocalSettings.php
* update $mantisDBSERVER, $mantisDBUSER, $mantisDBUSERPW, $mantisDBNAME, $mantis_home
* Usage:
* <mantis>#bugid</mantis>
*
* @version 0.2 schke 2008-10-31
* -change data input from php implode of bugsite to direct database access
@TerrorBite
TerrorBite / gist:8311290
Last active January 2, 2016 13:39
Stuff for secret stuff
View gist:8311290
enum rarities {
VERY_COMMON,
COMMON,
LESS_COMMON,
RARE,
VERY_RARE,
EXTRA_RARE
}
// 50, 25, 15, 7, 2, 1