Skip to content

Instantly share code, notes, and snippets.

View emanuele6's full-sized avatar
🐄

Emanuele Torre emanuele6

🐄
  • Provincia di Varese, Italy
  • 16:03 (UTC +01:00)
View GitHub Profile
@ormaaj
ormaaj / pattest.py
Last active June 21, 2024 23:05
Shell pattern quote/escape fuzzer.
#!/usr/bin/env python3
import subprocess, itertools
class Shell(list):
def __init__(self, shell, cmds):
self.shell = shell
super().__init__([(x, self.__run(x)) for x in cmds])
def __iter__(self):
#!/usr/bin/env ksh
typeset -a FUNCNAME
function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level = ${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
trap - DEBUG;
fi
@davidgiven
davidgiven / cpm.bas
Created May 31, 2023 21:43
This is a very barebones CP/M port for the Agon Light, using the BBC BASIC assembler to do all the work.
10 bbase=&FD00
20 fbase=bbase-3584
30 cbase=fbase-2048
40 iobyte=&0003
50 cdisk=&0004
60 bdoscall=&0005
70 bioscall=&0000
80 DIM code 4096
90 FOR pass=4 TO 7 STEP 3
100 P%=0
@emanuele6
emanuele6 / linenum.ed
Last active June 7, 2024 09:04
POSIX ed script that adds line numbers in front of the lines of a file.
1s/^/1 /
2,$g/^/-t -\
s/ .*//\
s/^9*$/0&/\
t .\
s/^.*[^9]\(9*\)$/\1 /\
s/9/0/g\
-s/9*$//\
s/8$/9/\
s/7$/8/\