Skip to content

Instantly share code, notes, and snippets.

@hoehrmann
hoehrmann / Xirip.pas
Created June 5, 2013 12:18
XiRip is a 1997 Turbo Pascal program that takes .xm music files and extracts the embedded instruments.
uses StrngTol;
type
parameter=record
FileName:String;
ExtractPath:String;
ShowHelpScreen:Boolean; {/?}
KeepInstName:boolean; {/K}
KeepSampName:boolean; {/S}
QuitOutput:Boolean; {/Q}
end;
@hoehrmann
hoehrmann / Guestbok.pas
Created June 5, 2013 12:55
1997 Turbo Pascal Web Guestbook CGI program, with <font> tags and other features.
{$M 16384,0,655360}
uses dos,strings,cgitool,filetool;
var OutBuf,InBuf:array[0..2047] of char;
gb:file;
i,j,k:integer;
ch:char;
susername,semail,sdate:String;
comment:array[0..2047] of char;
s,qs:string;
GesAnz:longint;
@hoehrmann
hoehrmann / lgpunp.pas
Created June 5, 2013 13:13
Final Fantasy VII (PC) .lgp package file extractor, anno 1998.
program LgpUnp;
(* Extracts Files from SquareSoft's Final Fantasy VII .LGP files *)
(* Copyright (c) 1998 by Bjoern Hoehrmann All rights reserved *)
var Index:record { Entry in the filelist at the beginning }
Name:array[0..19] of char; { Filename }
offset:longint; { FileOffset of this file }
res:longint; { Unused Data }
end;
@hoehrmann
hoehrmann / TEX2BMP.pas
Created June 6, 2013 10:41
Converter for .TEX texture files from SquareSoft's Final Fantasy VII to Windows BMP files.
{ _Add wildcards, parameter comfort, seperate file extraction for manipulation,
graphical output, check for xdim, memory using Speedup for swapping,..._ }
{$Q-}
program TEXfileUnpack;
(* Converts .TEX Files from SquareSoft's Final Fantasy VII TO BMP files *)
(* Copyright (c) 1998 by Bjoern Hoehrmann All rights reserved *)
type
@hoehrmann
hoehrmann / w3c-mailing-list-archive-to-mbox.js
Created June 8, 2013 10:08
User script ("greasemonkey script") web browser extension that shows on pages like http://lists.w3.org/Archives/Public/www-talk/ checkboxes to select periods and a [mbox] button that when clicked retrieves mails from the archive according to the selection and then turns them into plain text mbox files that can be saved to disk for import into ma…
// ==UserScript==
// @name Generate mbox files for W3C list archives
// @description Generate mbox files for W3C list archives
// @version 0.9
// @author Bjoern Hoehrmann
// @license GPLv3+
// @include http://lists.w3.org/Archives/*
// @include https://lists.w3.org/Archives/*
// ==/UserScript==
@hoehrmann
hoehrmann / 4wins.scm
Last active December 18, 2015 08:00
An implementation of Captain's mistress in Scheme written around 2003 as part of an assignment.
; +-------------------------------------------------------------------------+
; Bjoern Hoehrmann -- <[email protected]> -- <http://bjoern.hoehrmann.de>
; +-------------------------------------------------------------------------+
(define HEIGHT 6)
(define WIDTH 7)
(define X-WINS 4)
(define empty-char "-")
(define x-char "x")
@hoehrmann
hoehrmann / springer.scm
Created June 10, 2013 18:05
Solution for the knight's tour problem in Scheme written around 2003 as part of an assignment.
; Bjoern Hoehrmann -- <[email protected]> -- <http://bjoern.hoehrmann.de>
; Global constants and type definitions
(define empty-char 0)
(define HEIGHT 5)
(define WIDTH 5)
(define START-X 0)
(define START-Y 0)
(define-struct move (x y))
(define knightmoves
; Bjoern Hoehrmann <[email protected]> <http://bjoern.hoehrmann.de>
(require (lib "graphics.ss" "graphics"))
; Konstanten
(define BREITE 650) ; Breite des Fensters
(define HOEHE 255) ; Hoehe des Fensters
(define ERSTES-X 0.5) ; erster wert fuer x (es muss gelten 0<x<1)
(define WDH-SCHRITT-1 300) ; Wiederholungen im ersten Schritt
(define WDH-SCHRITT-2 100) ; Wiederholungen im zweiten Schritt
; Bjoern Hoehrmann <[email protected]> <http://bjoern.hoehrmann.de>
(require (lib "graphics.ss" "graphics"))
; Konstanten
(define width 720) ; Fensterbreite
(define height 570) ; Fensterhoehe
(define substlist (list 'a 60 'a -120 'a 60 'a)) ; Koch-Ersetzungsliste
; Globale Variablen
@hoehrmann
hoehrmann / waiting-for-dom-events-using-yield-2008.js
Created June 16, 2013 16:21
Abusing JavaScript generators and yield one can create task schedulers that essentially allow to write code that waits without blocking for asynchronous events. Originally http://lists.w3.org/Archives/Public/www-archive/2008Jul/0009.html and http://lists.w3.org/Archives/Public/www-archive/2013Apr/0043.html The difference between the two versions…
function OnYieldWaitForEvent(cor, target, name, phase) {
var self = arguments.callee;
target.addEventListener(name, function(evt) {
// We need to unregister the listener to save resources
// and to avoid getting called if the event occurs again
evt.currentTarget.removeEventListener(name, self, phase);
// Resume the waiting function
cor.next();