Skip to content

Instantly share code, notes, and snippets.

@rhaberkorn
rhaberkorn / theco.rex
Created November 22, 2012 23:56
Abandoned (Video)TECO implementation on top of The Hessling Editor, written in Open Object Rexx
#!/usr/local/bin/nthe -p
if .environment~theco.initialized \= .nil then return
/*
* Initialize classic Rexx function packages
*/
call ReLoadFuncs
/*
@rhaberkorn
rhaberkorn / rearrange.for
Created December 30, 2010 04:33
'shuffle' wave files (quick Open Watcom FORTRAN hack)
* Rearranges patches of a wave-file (shuffles them like a card deck)
program REARRANGE
include 'fsublib.fi'
@rhaberkorn
rhaberkorn / gist:759458
Created December 30, 2010 04:29
ye olde FORTRAN 77 obfu (99 bottles of beer)
C This one is almost an obfu, but valid FORTRAN 77
C Demonstrated features: character format identifiers, arrays as
C internal files, implied-DO-loops, importance of the blank character,
C rules for continuation lines, substrings, implicit type declaration...
565760C H ARA C T ERM S G ( 4 ) * 1 3 7
@rhaberkorn
rhaberkorn / xml.sc
Created December 30, 2010 04:23
Quick and dirty SNOBOL4/Snocone DOM-like XML parser
struct tag {type, params, lastp, children, last, parent}
struct param {name, value}
word = SPAN("_0123456789" && &LCASE)
xml = (("<!--" && ARB && "-->") $ *ITEM(children(current),last(current) = last(current) + 1) |
"<" && word $ *type(current = ITEM(children(current),last(current) = last(current) + 1) =
@rhaberkorn
rhaberkorn / exp2ook.sc
Created December 30, 2010 04:19
SNOBOL4 program to compile arithmetic expressions to Brainfuck/Ook!
# Snocone version (obscure C-like SNOBOL preprocessor)
stack = array(10); sp = 0
procedure push()
{
nreturn .stack[sp = sp + 1]
}
procedure pop()